Annotations in Spring boot with Explanation| Spring boot Interview Questions and Answers Code Decode

preview_player
Показать описание
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:

Course Description Video :

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:

So we can say this Spring boot annotations can’t exist on its own. It needs spring framework annotations to work.

@Target tag is used to specify at which type, the annotation is used.

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

@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 .

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

For example, when we define the spring-boot-starter-web dependency in our classpath, Spring boot auto-configures Tomcat and Spring MVC.

Subscriber and Follow Code Decode

#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

CodeDecode
Автор

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

tejasraje
Автор

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.

MehulSamaiya
Автор

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.

rajeevsai
Автор

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

sachinvm
Автор

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.

regow
Автор

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

sproutboot
Автор

Oh my god you’re gem 💎. Keep continue I’m a big fan of your explanation 🎉

SundaramMohan
Автор

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 😊.

amanbagdi
Автор

I don't know, but for me, these lessons are pure gold.

jonasjanaitis
Автор

Thanks mam! You are life saver with so many interview questions 🙌

hariomkumar
Автор

Yes please cover the rest of the questions, it will help!

monikashukla
Автор

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.

ArjunSingh-isbg
Автор

very useful content waiting for next video

praveenpippala
Автор

Really a big fan of the way you teach! Thanks a lot!

ashwinvarma
Автор

Superb explanation madam tq so much the way of explaining is easy to understand ur all vedeos are so helpful .

rachamallidorasrivignesh
Автор

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👍

arshpreetsingh
Автор

Thanks a lot, it's a great help for learners, please continue with remaining annotations

dgcrush
Автор

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

yatendrasingh
Автор

Yes please post videos for the other upcoming topics as well

rocker