Annotations in Spring Boot Interview Questions and Answers | Code Decode | Part -2

Поділитися
Вставка
  • Опубліковано 28 чер 2022
  • In this video of code decode of Annotations in Spring boot Interview Questions and Answers we have covered some common interview questions regarding spring boot annotations
    Udemy Course of Code Decode on Microservice k8s AWS CICD link:
    openinapp.co/udemycourse
    Course Description Video :
    yt.openinapp.co/dmjvd
    Annotations in spring boot part -1 : • Annotations in Spring ...
    It’s the way to implement Dependency Injection in spring / spring boot application.
    Container will provide the required bean to dependent bean at runtime
    Spring provides annotation-based auto-wiring by providing @Autowired annotation.
    It is used to autowire spring bean on setter methods, instance variable, and constructor.
    When we use @Autowired annotation, the spring container auto-wires the bean by matching data-type.
    How will container autowire the required bean in dependent bean at runtime ? It first need to create beans during startup so that it can provide beans at later stage.
    How will container know who POJO / java class should be considered as bean and whom to ignore ?
    @Component: It is a class-level annotation.
    It is used to mark a Java class as a bean.
    A Java class annotated with @Component is found during the classpath.
    The Spring Framework pick it up and configure it in the application context as a Spring Bean.
    It is a generic stereotype for any Spring-managed component. The specializations are @Controller, @Service, @Repository
    The @Controller is a class-level annotation.
    It is a specialization of @Component.
    It marks a class as a web request handler. It is often used to serve web pages. It is used in conjunction with @RequestMapping annotation.
    We also use @RestController when we need to send response in JSON format directly.
    By default, @Controller returns a string that indicates which route to redirect. Its used mostly with JSPs. It returns URL to new JSP page where it has to be redirected
    They are nothing but the specialized form of @Component annotation for certain situations. Instead of using @Component on a controller class in Spring MVC, we use @Controller, which is more readable and appropriate.
    The @Controller is a class-level annotation.
    It is a specialization of @Component.
    It marks a class as a web request handler. It is often used to serve web pages. It is used in conjunction with @RequestMapping annotation.
    We also use @RestController when we need to send response in JSON format directly.
    They are nothing but the specialized form of @Component annotation for certain situations. Instead of using @Component on a controller class in Spring MVC, we use @Controller, which is more readable and appropriate.
    By using @Controller annotation we do two things,
    We declare that this class is a Spring bean and should be created and maintained by Spring ApplicationContext,
    We indicate that its a controller in MVC setup. This latter property is used by web-specific tools and functionalities.
    DispatcherServlet will look for @RequestMapping on classes that are annotated using @Controller but not with @Component.
    This means @Component and @Controller are the same with respect to bean creation and dependency injection but @Controller is a specialized form of @Component. Even if you replace @Controller annotation with @Compoenent, Spring can automatically detect and register the controller class but it may not work as you expect with respect to request mapping.
    It is also used at class level.
    It is a specialization of @Component.
    It tells the Spring that class contains the business logic.
    But at the end The main task of this annotation is also to mark the class capable to become a bean in Spring container similar to component. We can use @component also and it will work the same as this annotation does.
    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
    #annotations #codedecode #springbootinterviewquestions

КОМЕНТАРІ • 98

  • @krishnalakshmi8896
    @krishnalakshmi8896 2 роки тому +8

    Please also make a third part with more annotations. Thanks for making these videos really helpful in cracking interviews.

  • @Ghost_k56
    @Ghost_k56 2 роки тому +1

    Thank you so much. Best channel to prepare for an interview on springboot and java

    • @CodeDecode
      @CodeDecode  Рік тому +1

      Thanks Kaushik for the appreciation

  • @aishwaryathakkar5909
    @aishwaryathakkar5909 2 роки тому +2

    Yes definitely, It is very helpful and please make 3rd part as well. :)

    • @CodeDecode
      @CodeDecode  2 роки тому

      Sure aishwarya we will create third part as well

  • @pranjalsingh1099
    @pranjalsingh1099 2 роки тому +5

    Anybody having basic language knowledge can watch your video and gain industry level knowledge ,each and every concept is explained in detail . Can you also make detail video on apache kafka

    • @CodeDecode
      @CodeDecode  2 роки тому

      Thanks Pranjal. Yes this video is in queue mostly tomorrow we will post something related to it👍

  • @pnkirankumar6298
    @pnkirankumar6298 2 роки тому +3

    Am Fallen in Love with #CodeDecode, I am from Mech Background, working in IT field currently. When I start your playlist, You will never fail in making me understand the things in a perfect way. Thanks a Lott💌. Want more Videos.

    • @CodeDecode
      @CodeDecode  2 роки тому +2

      Means a lot to us KiranKumar❤thanks for being with us🙂🙂

  • @veerayuvakishore1775
    @veerayuvakishore1775 Рік тому +1

    nicely curated and well explained, looking for more videos.

  • @vengateshm2122
    @vengateshm2122 2 роки тому +1

    Informative video

  • @revatisrr2057
    @revatisrr2057 Рік тому +1

    You are awesome.. awesome in making words simpler and understandable..thanks a lot

  • @nikitamehto5596
    @nikitamehto5596 2 роки тому +1

    Please make the 3rd part as well. The videos are really very helpful. Thank you.

    • @CodeDecode
      @CodeDecode  2 роки тому

      Thanks Nikita. Sure will upload soon 🙂👍

  • @RRamasami
    @RRamasami 4 місяці тому +1

    Great and very helpful. Thanks a lot 🙏🏾

  • @yatharthyadav9671
    @yatharthyadav9671 2 роки тому +1

    very informative , it clears all the doubts plz make 3rd part as well

    • @CodeDecode
      @CodeDecode  2 роки тому

      Thanks Yatharth will create next part soon👍🙂

  • @murgeshhiremath3765
    @murgeshhiremath3765 Рік тому +1

    Thanks for making this video this is the best for beginners

  • @rajraj8065
    @rajraj8065 2 роки тому +1

    Awesome 👍🏻 Explanation

  • @akankshaseth5718
    @akankshaseth5718 2 роки тому +1

    Was waiting for this vedio

  • @mitechnologies2451
    @mitechnologies2451 Рік тому +1

    very useful video , thank you

  • @sravantigopisetty2270
    @sravantigopisetty2270 2 роки тому +1

    Hi CodeEcode, wonderful explanation. Please do add thre remaining annotations also.It will be very helpfull

    • @CodeDecode
      @CodeDecode  2 роки тому

      sure sravanti we will upload it soon

  • @poojaranavare6902
    @poojaranavare6902 2 роки тому +1

    very understandable explanation thanks !!!! please make videos on rest of the annotations

  • @hackstreet781
    @hackstreet781 Рік тому +1

    Awesome channel

  • @GauravKumar-lq5ql
    @GauravKumar-lq5ql 2 роки тому +1

    Thanks for this wonderful and informative video. Please make video for the left out annotations.

  • @Lipunknb
    @Lipunknb 2 роки тому +1

    Awesome. Please make more videos on spring boot annotations

  • @sachinjadhav8759
    @sachinjadhav8759 2 роки тому +1

    nice explanation

  • @Vithal_Nivargi
    @Vithal_Nivargi 2 роки тому +1

    Very important video Thanks mam, please I would request you make video on scenario based questions on spring boot

  • @kalekar100
    @kalekar100 2 роки тому +1

    Thanks 😊

  • @varunsiddarth1265
    @varunsiddarth1265 2 роки тому +1

    Nice video

  • @b.vishnuvardhan3704
    @b.vishnuvardhan3704 2 роки тому +1

    Well explanation pls make third part too

  • @sproutboot
    @sproutboot Рік тому

    Fun !

  • @amitjoshi940
    @amitjoshi940 2 роки тому +2

    Thanks mam please upload more annotations

    • @CodeDecode
      @CodeDecode  2 роки тому +1

      Sure Amit. We will do that👍🙂

  • @kirankumar2806
    @kirankumar2806 2 роки тому

    Hi CodeDecode, Your doing a great job by explaining the complex concepts in simpler manner.
    Can you please make videos on dataStructure and algorithms.

    • @CodeDecode
      @CodeDecode  2 роки тому +1

      sure kiran we will try to create videos on data structure and algorithm soon

  • @akashsaha9366
    @akashsaha9366 2 роки тому +3

    Thanks maam, please show us more annotations

  • @abhimanyusingh8157
    @abhimanyusingh8157 10 місяців тому +1

    please make the second part of it as sson as possible

  • @kavithaeswaradoss8970
    @kavithaeswaradoss8970 Рік тому +1

    Hi pls add third part of this .. 😊waiting

  • @akshatmathur278
    @akshatmathur278 Рік тому +1

    Please make the third part as well.

  • @Akshay-fz7ms
    @Akshay-fz7ms Рік тому

    Please cover @Conditional, @Profile,. @Import etc..

  • @Rohit.Kumar.726
    @Rohit.Kumar.726 Рік тому

    What will happen if we interchange service annotation and repository annotation ? will it work ?

  • @tejeswarpala2841
    @tejeswarpala2841 Рік тому +1

    Waiting for the 3rd part. please do asap.

  • @ArjunSingh-is1bg
    @ArjunSingh-is1bg 2 роки тому +1

    First on Your Video Mam

    • @CodeDecode
      @CodeDecode  2 роки тому +1

      Thanks a lot Arjun 🙂🙂🙂🙂

    • @ArjunSingh-is1bg
      @ArjunSingh-is1bg 2 роки тому

      @@CodeDecode Hey mam i have some doubts and questions regarding Junit and mockito, please mam make a series of videos on that and share your real world scenerios how code smels , how to impove our code quality , You know as i discuss you previously about this topic

  • @philomath_u
    @philomath_u Рік тому

    But employee bean is created, even if you comment @Component on Address Bean while it is autowired, because I can see the constructor of Employee Bean is getting called... so if the constructor is being called then how can we say the Employee Bean is not created. Correct me if I am wrong.. see from timestamp 05:54

  • @nupurshukla444
    @nupurshukla444 Рік тому +1

    Please make third part of it.

  • @Joe-qv2jo
    @Joe-qv2jo Рік тому

    What is a bean. Is there a video for it

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw 2 роки тому

    why did you make Address class also @Component

  • @user-ej3le1rf4i
    @user-ej3le1rf4i Рік тому +2

    Nice Questions....but honestly I need to give feedback that I feel your answers have more theory rather than explaining with simple terms (Need to cut it short). And also one more thing the audio narration levels are so sharp for theoretical explanation makes people get diverted with lot of information. Other than that you are really awesome. Great job.

    • @CodeDecode
      @CodeDecode  Рік тому

      Sure Aswin. we will work on reducing our content. We just tried to make it for those who don't even know about the topic that's why it might seem lame sometimes. Is that the case here Aswin ?

  • @user-te5cp2cq1v
    @user-te5cp2cq1v Рік тому +1

    please make the 3rd part asap

  • @akadeadahot7067
    @akadeadahot7067 10 місяців тому +1

    all questions are having the annotation replacement @component then why we are studying all these annotation according to video as u demonstrate we can use always @component every where XD

    • @CodeDecode
      @CodeDecode  10 місяців тому

      For better readability we are using different annotations. You can try replacing all of them with @component and still ur app will work as is.

  • @adi1140
    @adi1140 10 днів тому

    Part 1 continue , you have not completed that component scan part

  • @abusalem.ershad
    @abusalem.ershad 2 роки тому

    Hello, Ma'am, I saw your many videos but you had not given any pdf of these questions if possible provide it. Because it helps us a lot if we get a pdf file.

    • @abusalem.ershad
      @abusalem.ershad 2 роки тому +1

      I saw your all videos.

    • @Aniketwagh8
      @Aniketwagh8 2 роки тому +1

      Yes ,if possible please provide the pdf files

    • @AmanRajCSE--
      @AmanRajCSE-- 2 роки тому

      Yes, you can put pdfs in discriminations.

  • @nimitchaudhary7213
    @nimitchaudhary7213 2 роки тому +1

    when will next one come...

  • @mir5311
    @mir5311 2 роки тому +1

    Show us more annotations

  • @remyajose7854
    @remyajose7854 11 місяців тому

    please give the project

  • @sabareeshreddy2249
    @sabareeshreddy2249 Рік тому +1

    i want that pdf