Difference between @component & @bean annotations in Spring boot | Interview Question | Code Decode

Поделиться
HTML-код
  • Опубликовано: 10 дек 2024

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

  • @akashshaw3988
    @akashshaw3988 Год назад +19

    The main difference is with @Bean you are able to instantiate beans for third party library objects where you do not have the access to the source code to add @Component annotation. for example PasswordEncoder.
    @Bean annotation provides more control over how you want to create the bean.

  • @GreenAspirant
    @GreenAspirant 9 месяцев назад +1

    Ma'am please continue doing such videos.... thanks for covering whole concept in depth

    • @CodeDecode
      @CodeDecode  9 месяцев назад

      Sure we will cover more like this

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

    It was very clear and easy to remember also.Glad am the first person to comment 😊

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

      Thanks for the first comment!! 😊😊.

  • @swapnilmishra697
    @swapnilmishra697 Год назад +2

    Very clear and concise

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

    Great time management. 🎉

  • @josephnairpudupermanil8679
    @josephnairpudupermanil8679 11 месяцев назад +1

    Nice content

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

    Your videos are really really very helpful 🎉

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

    Very well explained

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

    Thanks for this video keep it mam

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

    Nice explanation 🙏

  • @maheshh6179
    @maheshh6179 Год назад +3

    Its better to show writing full code flow to understand littlest bit clearly

  • @killingmachinelp
    @killingmachinelp Год назад +3

    I think conditional can be used with component or service annotations.

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

      Correct but method in which@bean is annotated will do custom logic which @component can't do.

  • @sayyedhameed8893
    @sayyedhameed8893 6 месяцев назад +1

    Thanks

  • @swapnilnigam7716
    @swapnilnigam7716 4 месяца назад

    Mam I want to schedule for interview
    How can I

    • @CodeDecode
      @CodeDecode  4 месяца назад

      please enroll yourself via google form link in the latest video on channel

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

    🙏👍

  • @rammohan-ui1fz
    @rammohan-ui1fz 9 месяцев назад

    Voice is not clearly