Annotations in Spring boot with Explanation| Spring boot Interview Questions and Answers Code Decode
Вставка
- Опубліковано 10 тра 2022
- In this video of code decode we have explained about Annotations in Spring boot. Annotations in spring boot is very important Interview in Spring boot interview questions and answers.
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/udemycourse
Course Description Video :
yt.openinapp.co/dmjvd
Spring boot annotations
Spring Boot is the most popular Java framework. Spring Boot built upon spring framework. It minimize the amount of configuration and boilerplate code you need to get started.
The Java provided support for Annotations from Java 5.0.
Prior to that, the behavior of the Spring Framework was largely controlled through XML configuration. Today, the use of annotations provide us tremendous capabilities in how we configure the Spring Framework.
Spring Annotations are a form of metadata. Annotations are used to provide supplemental information about a program. It does not have a direct effect on the operation of the code they annotate. It does not change the action of the compiled program.
@SpringBootApplication
It is a combination of three annotations
@EnableAutoConfiguration,
@ComponentScan, and
@Configuration.
if you see at their parent packages:
org.springframework.boot.autoconfigure.EnableAutoConfiguration
org.springframework.context.annotation.Configuration
org.springframework.context.annotation.ComponentScan
So we can say this Spring boot annotations can’t exist on its own. It needs spring framework annotations to work.
Annotations on annotations-@Target
@Target tag is used to specify at which type, the annotation is used.
The java.lang.annotation.ElementType enum declares many constants to specify the type of element where annotation is to be applied such as TYPE, METHOD, FIELD etc. Let's see the constants of ElementType enum:
Element Types Where the annotation can be applied
TYPE class, interface or enumeration
FIELD fields
METHOD methods
CONSTRUCTOR constructors
LOCAL_VARIABLE local variables
ANNOTATION_TYPE annotation type
PARAMETER parameter
Annotations on annotations-@Retention
@Retention annotation is used to specify to what level annotation will be available.
RetentionPolicy.SOURCE - refers to the source code, discarded during compilation. It will not be available in the compiled class.
RetentionPolicy.CLASS refers to the .class file, available to java compiler but not to JVM . It is included in the class file.
RetentionPolicy.RUNTIME refers to the runtime, available to java compiler and JVM .
Annotations on annotations-@Inherited @Documented
By default, annotations are not inherited to subclasses. The @Inherited annotation marks the annotation to be inherited to subclasses.
The @Documented Marks the annotation for inclusion in the documentation.
@Configuration
Tags the class as a source of bean definitions for the application context.
Point to note-
The main application class is also a bean, as it's annotated with @Configuration, which is a @Component.
@EnableAutoConfiguration
The @EnableAutoConfiguration annotation enables Spring Boot to auto-configure the application context. Therefore, it automatically creates and registers beans based on both the included jar files in the classpath and the beans defined by us, implicitly @EnableAutoConfiguration annotation, which makes Spring Boot create many beans automatically, relying on the dependencies in pom.xml file.
For example, when we define the spring-boot-starter-web dependency in our classpath, Spring boot auto-configures Tomcat and Spring MVC.
If you have added tomcat-embedded.jar then it tries to intellectually configure TomcatServletWebServerFactory if you do not have specified explicitly as ServletWebServerFactory bean. Hence, this auto-configuration has less precedence in case we define our own configurations.
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
SQL Playlist : • SQL Interview Question...
GIT : • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode : ua-cam.com/users/CodeDecode?...
LinkedIn : / codedecodeyoutube
Instagram : / codedecode25
#codedecode #Springbootannotations #springbootinterviewquestionsandanswers
Hey Guys, In this video we have covered very important and very in-depth concepts of spring boot annotations. So please watch this video till very end as it will indirectly cover many interview questions of Spring boot annotations. Also please like share and subscribe and let us know in the comment sections if you want us to create second part of Spring boot annotations
Thank you for all your efforts, your videos really helped me to gain confidence before going to the interview. Please create a continuation video for this video as well.
Thanks for ur efforts its really informative. please do such videos more. and please cover how to convert existed project to spring boot application. Thankful for what you are doing.
please create second part for this. thank you
Hi @codeDecode
Can please make one video on full spring boot interview question with live example for experience people. As I saw you made video on annotation only.so try to make video on other parts also.
Please make soon🙏🏻
Hi can you give me the video URL for spring cloud config server example
I cracked 2 interviews within a week after watching your entire interview series. You're a savior for Java Developer Interviews. Thanks a lot and i urgue you to make more such video's on advanced java and spring boot concepts
Many congratulations Tejas. Very well deserved 👏👏👏👏keep learning keep growing Man 🙂🙂👍👍
Hi@@poorvakatyal2477 . I've 1.5 years in java springboot
@@tejasraje2672 which company teja
Could you please tell me which interview series you are talking about, there multiple series available on this channel?
@@rushikeshgodase8498 ua-cam.com/video/PwiuAebCruY/v-deo.html
Thank you very much for this video. I have been seeing these basic annotations from sometime now, but never understood what each thing does. I got more clarity now. Please continue with this series. Thank you for helping all the confused developers like me.
Been though the same situation. Hence decided to create a video to clarify many developers like us 🙂🙂. Thanks for supporting us and motivating us . Means a lot Rajeev 🙂👍
@@CodeDecode thank you for your reply and assurance. 🙏🏻
Thank you! This is very helpful. I learned so much more about spring boot with this video and this is just one spring boot annotation.
Definitely I want you to cover more-! I love your explanation. Always your explanation is very clear. easy to understand. I like when you show us related demo
Thanks a lot Lee🙂🙂
To be very honest for annotations i searched for so many videos but was unable to understand it clearly and after going through your video its now crystal clear. Thanks a lot, u r doing a good work keep it up....toodles.
Thanks Mehul🙂🙂👍
Really a big fan of the way you teach! Thanks a lot!
Thanks a lot Ashwin 🙂🙂
Thanks mam! You are life saver with so many interview questions 🙌
Thanks a lot Hariom. We are glad to be. We will keep posting such videos 🙂👍
Yes please cover the rest of the questions, it will help!
Sure thanks Monika for showing us the way to proceed with. 🙂👍
The internal working of annotations is explained very well, please continue on it and cover the other annotations as well like
@Autowired n all. Thanks 😊.
Thanks a lot Aman. Sure we will do that🙂👍
One of the best video I have seen explaining how the spring boot application works internally with all these annotations. Please request u to cover the rest of the annotations, that would really help your subscribers. Thanks again
Thanks Sachin sure 👍
Thanks a lot, it's a great help for learners, please continue with remaining annotations
Thanks chandr. 🙂👍. Sure we will continue this series
I don't know, but for me, these lessons are pure gold.
Thanks Jonas 🙂🙂
Thanks for this knowledgeful video. please continue more of this...
Thanks Uddeshya. Sure we will do that 🙂👍
very useful content waiting for next video
Thanks a lot praveen 🙂👍
wonderful explaination , i got from your interview series pls make more videos on the subsequent topics, Today i found your channel and got subscribed in half of the video ,best content on you tube to the point with great depth of the topic.thanks
Thanks a lot Yatendra 🙂means a lot to us👍🙂
Awesome one, really appreciate your efforts
Thanks a lot Ravi 🙂👍
Thanks for your efforts. Please do continue this spring boot annotations series.
Sure. Thanks a lot for helping us decide the priority. Means a lot, 🙂👍
Thanks for this video ...please continue on this
Sure harshada
Thank you mam , which i was waiting for such videos.... 😊
You're welcome
Superb explanation madam tq so much the way of explaining is easy to understand ur all vedeos are so helpful .
Thanks a lot 🙂👍
This Video is really helpful, Currently i am working on spring i have one have diffculty is , I have to thought much more about the configuration in the Spring and then Spring Boot comes and make alll the automation and reduce the boiler plate code and make life of the Java Developer Easy.
So glad to hear that u are able to feel it on job. Apply and learn as much as you can Arjun. We can see you are perfectly on the right track. You will for sure land at your dream job with such worthy knowledge you are gaining day by day 🙂👍 keep learning keep growing Man. Glad to see this 👏👏👏👏
@@CodeDecode Tq Mam, You Also So supportive in my journey of the Java Developer.🙂🙏
Excellent ma.. detaily explained . Really appreciate it. . Pls do cover all other topics. . . . Thanks for your videos. .
Thanks a lot Bhuvana 🙏🙏. Sure we will cover more annotations in next videos
Great work. Thanks!
Thanks a lot Prabakar 🙂👍
This is amazing. So deep
Thanks
Yes please post videos for the other upcoming topics as well
Sure Prabakar 🙂👍
most useful channel for interview preparations, cleared the interview of a very good product based company with the help of your videos. Thanks a lot mam for providing such useful content🙏🙏 Keep creating such useful videos👍
Thanks for the nice words arshpreet
Thanks for your efforts. Please do continue this series.
Can u please share this document that can be really helpful for us.
Please do create. Your videos are quite helpful. You elaborate in details.
Thanks Khushboo 🙂👍
You doing a great job. Could you bring up a series on JMS , ActiveMq, RabbitMq, Kafka , etc in combo with Spring Boot. Would be very helpful. Not many videos on UA-cam of JMS in combo with spring boot
What is com.sun.proxy.$proxy.i got this as runtime exception.what to resolve this exception.
Thanks for the great videos Mam. Can you create a series on handling database transactions when a call go through multiple micro services? And each micro service has its own database.
Yeah it's in right direction. Please cover other part also..
sure we will cover it soon
Yes, please cover the rest of the annotations.
Sure thanks Prakash 🙂👍
Very useful video..
Thanks Shekar 🙂👍
Yes please cover the required beans or annotations of spring boot
Sure Akash 🙂👍
Please mam,cover remaining part as well,it would be helpful,thank you so much for your wonderful content,thanks a ton😀😊
Thanks Vidya 🙂
Thank you it's really useful. Please do more videos on @annotations
Sure ravi
Big fan of you ma'am. Can you please share these slides as well for further revision.
And thanks for making this.
you're welcome
Please upload complete annotation interview questions of spring boot application. Thanks alot for making such good contents❤️
Sure 🙂👍
500th Like Im Giving... 👍
This is by far the best youtube channel for interview preparation. Thank you so much. Please create second part of this series.
This means a lot to us sourabh. 🙂🙂🙂🙂. You made our day with such comments. It helps us to be motivated and post more such content 🙏🙏🙏🙏
Awesome
Thanks Sachin 🙂
please make a video for how to retrieve value from hashmap having same index number.
Great explanation. Your voice sounded little hyper. Please stay calm while making videos.
Waiting for part 2 of this video
Sure we will upload it soon
Wonderful explanation. Thanks for sharing the annotations tutorial, it cleared lot of doubts.
I've one suggestion, your voice is very loud in all your videos, it feels like you are shouting. It seems you are a teacher and are habitual to speaking loud while teaching in the class but in the video it feels a bit screeching to the ears and hence not required. Please try to curb that habit if you are delivering for the video only.
Thanks ma
🙂👍
Please more videos on microservices, design patterns
Sure we will upload soon
Mam Please make a video on how to explain a project based on springboot + mysql + java + with any frontend... As i dont have perfect idea on my entire project flow.
@ThanksForSharing
Thanks Amarthya 🙂👍
Hi Mam, Hope you’re well. I cracked many interviews because of u.
Now i am confused to join between American Express and EY. Can you pls help me to decide which one is better.
How is job security at Amex??
Hey hi Harish. First of all many congratulations on clearing both. As far as our experience says, company never matters what really matters is the project. If project is good your life is smooth as butter . But if project is not as per the expectations your life will become hell. Avoid toxic it culture . Ask about the tech stack and client you will work with closely. If stack is good u will learn new things and will never feel stagnated . Go ahead and ask for the project and tech stack . All the best Harish . You will rock 🙂👍👍👍
Can you please make a video on advance multithreading questions.
Sure Ruchi. We will do that🙂👍
Do the video of clients round interview 🙏
That's a very nice topic we will surely cover it in coming future
What is com.sun.proxy.$proxy. I got this as runtime exception.how to resolve this exception.
Can you share some scenario based java interview questions
Sure what kind of scenerios you need?
Will you make video on SpringBoot application Deployment process
sure we will create it in future
Please make a video on spring data jpa
Sure Mahi. We wll do that 🙂👍
Hi Mam. I am a house wife mother of 3. Now I got a opportunity to enter the software field as basic Java and spring boot developer. Can you help me what are the expected topics that I need to cover.? Do I have to do more practice on coding or just the concepts..?
Prepare well with all concepts thoroughly. Because with some gaps its very difficult to start again. We know thoughtworks is one who gives mothers with gaps to join back. Try that👍🙂
Do you give trainings as well?
Not yet Mounika. We all are full time developers at MNCs. Hardly get time to create videos even. Sorry. What do u need??❤❤.
Please upload remaining annotations those filters annotations...🥺
Sure nabin we have uploaded one more video please check that out
Please make a video on apache kafka tutorial.
sure we will upload this video in near future
@@CodeDecode thanks.
Hi, when can we expect the next part?
we have uploaded it yesterday
You are so cute.. We all so greatful to you
Thanks 🙂🙂
Could you please share the slides used in the video?
Speaking too fast..
We will reduce the pace👍