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

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • 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/u...
    Course Description Video :
    yt.openinapp.c...
    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 : www.youtube.co...
    LinkedIn : / codedecodeyoutube
    Instagram : / codedecode25
    #annotations #codedecode #springbootinterviewquestions

Комментарии • 98

  • @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👍

  • @krishnalakshmi8896
    @krishnalakshmi8896 2 года назад +8

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

    • @CodeDecode
      @CodeDecode  2 года назад +4

      Thanks Krishna 🙂👍

  • @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🙂🙂

  • @revatisrr2057
    @revatisrr2057 Год назад +1

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

  • @Ghost_k56
    @Ghost_k56 2 года назад +1

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

    • @CodeDecode
      @CodeDecode  2 года назад +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

  • @murgeshhiremath3765
    @murgeshhiremath3765 Год назад +1

    Thanks for making this video this is the best for beginners

  • @RRamasami
    @RRamasami 5 месяцев назад +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👍🙂

  • @amitjoshi940
    @amitjoshi940 2 года назад +2

    Thanks mam please upload more annotations

    • @CodeDecode
      @CodeDecode  2 года назад +1

      Sure Amit. We will do that👍🙂

  • @akashsaha9366
    @akashsaha9366 2 года назад +3

    Thanks maam, please show us more annotations

  • @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 🙂👍

  • @abhimanyusingh8157
    @abhimanyusingh8157 Год назад +1

    please make the second part of it as sson as possible

  • @veerayuvakishore1775
    @veerayuvakishore1775 2 года назад +1

    nicely curated and well explained, looking for more videos.

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

  • @mitechnologies2451
    @mitechnologies2451 Год назад +1

    very useful video , thank you

  • @akshatmathur278
    @akshatmathur278 Год назад +1

    Please make the third part as well.

  • @akankshaseth5718
    @akankshaseth5718 2 года назад +1

    Was waiting for this vedio

  • @poojaranavare6902
    @poojaranavare6902 2 года назад +1

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

  • @rajraj8065
    @rajraj8065 2 года назад +1

    Awesome 👍🏻 Explanation

  • @Lipunknb
    @Lipunknb 2 года назад +1

    Awesome. Please make more videos on spring boot annotations

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

  • @GauravKumar-lq5ql
    @GauravKumar-lq5ql 2 года назад +1

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

  • @kavithaeswaradoss8970
    @kavithaeswaradoss8970 Год назад +1

    Hi pls add third part of this .. 😊waiting

  • @vengateshm2122
    @vengateshm2122 2 года назад +1

    Informative video

  • @hackstreet781
    @hackstreet781 Год назад +1

    Awesome channel

  • @b.vishnuvardhan3704
    @b.vishnuvardhan3704 2 года назад +1

    Well explanation pls make third part too

  • @nupurshukla444
    @nupurshukla444 Год назад +1

    Please make third part of it.

  • @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 ?

  • @sachinjadhav8759
    @sachinjadhav8759 2 года назад +1

    nice explanation

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

  • @tejeswarpala2841
    @tejeswarpala2841 Год назад +1

    Waiting for the 3rd part. please do asap.

  • @varunsiddarth1265
    @varunsiddarth1265 2 года назад +1

    Nice video

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

  • @sproutboot
    @sproutboot Год назад

    Fun !

  • @kalekar100
    @kalekar100 2 года назад +1

    Thanks 😊

  • @Rohit.Kumar.726
    @Rohit.Kumar.726 Год назад

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

  • @akadeadahot7067
    @akadeadahot7067 Год назад +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  Год назад

      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.

  • @user-te5cp2cq1v
    @user-te5cp2cq1v Год назад +1

    please make the 3rd part asap

  • @Akshay-fz7ms
    @Akshay-fz7ms 2 года назад

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

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw 2 года назад

    why did you make Address class also @Component

  • @Joe-qv2jo
    @Joe-qv2jo 2 года назад

    What is a bean. Is there a video for it

  • @adi1140
    @adi1140 Месяц назад

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

  • @mir5311
    @mir5311 2 года назад +1

    Show us more annotations

  • @nimitchaudhary7213
    @nimitchaudhary7213 2 года назад +1

    when will next one come...

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

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

  • @remyajose7854
    @remyajose7854 Год назад

    please give the project

  • @sabareeshreddy2249
    @sabareeshreddy2249 Год назад +1

    i want that pdf