Тёмный

Tricky Interview Question | Difference Between POJO and JavaBean class | POJO vs Java Bean 

TechStack9
Подписаться 7 тыс.
Просмотров 9 тыс.
50% 1

This video explains the following
1) POJO class with example
2) Java Bean class with example
3) Differences Between POJO and JavaBean
Checkout the Playlists:
👉 Java Tutorial For Beginners:
• #1 JAVA INTRODUCTION |...
👉 Design Patterns in Java
• What is Singleton Desi...
👉 Tricky Java Interview Questions
• Tricky Interview Quest...
👉 Important Java Programs for Interview:
• Important Java Program...
👉 How to Avoid Common Mistakes as a Java Beginner
• How to Avoid Common Mi...
👉 Interview Coding Challenges
• Coding Interview Quest...
👉 MySQL Tutorial For Beginners:
• MySQL Tutorial For Beg...
👉 What is Agile | Understanding Agile Software Development Process:
• What is Agile | Unders...
👉 Selenium with Java Tutorial For Beginners:
• #1 Introduction to Sel...
LIKE | SHARE | SUBSCRIBE 😊
#java #pojo #javabeans
👇👇👇
Follow me on
LinkedIn: / mahesh-babu-mande-6592...
Telegram: t.me/techstack9
Twitter: / mahesh1049

Наука

Опубликовано:

 

20 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@AlejandroFedorov
@AlejandroFedorov 2 года назад
Starts from 7:40
@tabishrizwan9137
@tabishrizwan9137 Год назад
1.Not only Bean, any java class without defined constructor will have a default no-argument constructor, but if you add any constructor with arguments, you need to explicitly define a no-argument constructor. can u illustrate
@tabishrizwan9137
@tabishrizwan9137 Год назад
If we add any constructor with arguments it's not mandatory to define no-argument constructor. if we are creating other object with no-argument constructor then it will cause an issue. In that situation u need to mention no-argument constructor because compiler will not generate default constructor due to availability of parametrized constructor.
@beatalert123
@beatalert123 2 года назад
Superb explanation. Thank you.
@TechStack9
@TechStack9 2 года назад
Thank you !!
@andresdiaz2737
@andresdiaz2737 Год назад
Super useful explanation. Can I still have an arguments constructor in a Java Bean?
@TechStack9
@TechStack9 Год назад
Yes. We can !!
@RedlikMusic
@RedlikMusic Год назад
but it is actually true that all beans are pojos since the pojos are not suposed to implement anything, right?
@TechStack9
@TechStack9 Год назад
Correct. This is what has been mentioned at end of the video.
@kavindu
@kavindu Год назад
Mate, I finished this video with more questions than I had before starting it. You've managed to explain perfectly how to code a POJO and Java Bean. But you completely failed you explain WHY. E.g.: 1. Why can't the Java Bean constructor have parameters? 2. Why do the instance variablesn in a Java bean need to be private? 3. Why can't you directly access a Java Bean's variable directly? (i.e. Why do we HAVE to use the getter and setter methods?) And many more.
@TechStack9
@TechStack9 Год назад
Thanks for the honest feedback. Wanted to keep video simple to the content. Also, I think most of the questions are self-explanatory. 1.Not only Bean, any java class without defined constructor will have a default no-argument constructor, but if you add any constructor with arguments, you need to explicitly define a no-argument constructor. 2.Reason was explained "Why implementing Serializable interface" at 4:03. To keep data secure the very purpose of 'private' access-modifier. 3.Again for the same reason as 2. You can't access as they are defined private. So, we have 'public' getters and setters to access the private instance variables. Hope this clarifies. But I take your point of WHY 👍
@kavindu
@kavindu Год назад
@@TechStack9 Thanks! That clarifies everything. Looking forward to more videos :)
Далее