What is a POJO in Java? Almost EVERYONE Gets This Wrong

  Рет қаралды 118,422

Coding with John

Coding with John

Күн бұрын

Complete Java beginner's course: codingwithjohn.thinkific.com/...
What is a POJO in Java? You probably know POJO stands for Plain Old Java Object, but what does that mean? So many others get this wrong, so my goal is to clarify the confusion - it doesn't have to be complicated. But it does have to be right.
Learn exactly what a POJO means in the Java world, and where it came from. Also learn a common mix-up between a POJO and a Java Bean.
POJOs seem like a fancy or complicated term, but it's really super simple!
Learn or improve your Java by watching it being coded live!
Hey, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java developers.
Let me know what else you'd like to see!
Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.
📕 THE best book to learn Java, Effective Java by Joshua Bloch
amzn.to/36AfdUu
📕 One of my favorite programming books, Clean Code by Robert Martin
amzn.to/3GTPVhf
🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial
www.audibletrial.com/johnclean...
🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)
bit.ly/3QPNGko
📹Phone I use for recording:
amzn.to/3HepYJu
🎙️Microphone I use (classy, I know):
amzn.to/3AYGdbz
Donate with PayPal (Thank you so much!)
www.paypal.com/donate/?hosted...
☕Complete Java course:
codingwithjohn.thinkific.com/...
codingwithjohn.com

Пікірлер: 179
@bissen
@bissen 3 жыл бұрын
Awesome, clear and simple explanation of something I've been scratching my head over trying to understand DTOs and Entities in relation to adding new data to a database. Thank you, truly.
@roldanreal2534
@roldanreal2534 2 жыл бұрын
Thank you so much. I’m a new subscriber and every video you post is like a refresher to me in a way. You are a great help to everyone in the community, whatever experience and programming level they are right now.
@Vinicius28636
@Vinicius28636 2 жыл бұрын
Man, your videos are just so good! Congratulations on your work!
@ShaileshDagar
@ShaileshDagar Жыл бұрын
Your explanantions are quite elegant. Thanks for doing these. Would love to know more about Serializable.
@anirbandebroy198
@anirbandebroy198 2 жыл бұрын
Love your short videos. Thanks
@jaimesastre6393
@jaimesastre6393 2 жыл бұрын
Excellent as always. Simple, clean and clear. And I clearly learned something. Thank you John. 😉
@rollosroyce6812
@rollosroyce6812 2 жыл бұрын
Thank you. Its was the best understanding pojo and Serializable. Good luck
@idomoshe6040
@idomoshe6040 2 жыл бұрын
Your videos are awesome, with clear and concise explanation, thank you! I hope you make a video about beans and inversion of control, just because I think your explanation will be clearer than other's.
@JaiBharat-ti6xz
@JaiBharat-ti6xz 2 жыл бұрын
Thank you so much for the short precise and clear elaboration with example. Could you please provide the difference between ValueObject and POJO?
@jarlfenrir
@jarlfenrir 2 жыл бұрын
Value object should be immutable and in your code two value objects with same values set to their fields should be treated as equal.
@bwprogrammers874
@bwprogrammers874 3 жыл бұрын
i am learning java the easy way, but i wonder how come you dont have so much subscribers!!! Anyway keep giving good content. Love u from Botswana, Africa.
@domal5818
@domal5818 2 жыл бұрын
What a nice video. it was very usual for me, because in the web arent mutch informations availible. Short and onPoint!
@johnkeck
@johnkeck 2 жыл бұрын
Great video, very clear. Thank you, John! A couple questions: Is a Java bean a POJO? It implements another class. Or would it cease to be one only if it implemented an *outside* class? (Since Serializable is a "built-in" Java class, a bean can still count as a POJO.) Also, what if one of the fields of the class has a data type that depends on (or is) another class? Would that still be a POJO?
@FukSN
@FukSN 2 жыл бұрын
To the point and very clear. Thanks John.
@MK_AU
@MK_AU 2 жыл бұрын
Short and clear. Thanks.
@HR-pz7ts
@HR-pz7ts 4 ай бұрын
You're so good as always John!
@cynthita93
@cynthita93 2 жыл бұрын
Great explanation!!! THANK YOU JOHN!!!!
@BroSanch
@BroSanch Жыл бұрын
Very eloquent and concise! Do you have any advice on how to use JPA with multiple java beans?
@ticianofilho16
@ticianofilho16 2 жыл бұрын
Very clear explanation. thanks for sharing it.
@StickOnLSD
@StickOnLSD 2 жыл бұрын
thank you i learn so much through your sessions!
@oLunatiko
@oLunatiko 2 жыл бұрын
Thank you, I love watching your videos.
@avgSE81
@avgSE81 10 ай бұрын
I love your videos. They are really informative. Thanks!
@chlikhita2531
@chlikhita2531 Жыл бұрын
Thanks for putting it in simple words!
@DannyJulian77
@DannyJulian77 2 жыл бұрын
Can you talk about DTO (Data transfer object classes). I see that people has many definitions for that
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
In my experience a DTO is basically a simple class, usually a POJO, whose job is to work as a middle-man between two representations. For example, you might have a web service request with a certain class structure, and also a database entity with a similar, but separate class structure. To avoid tightly coupling those two classes together, we typically will have a DTO (data transfer object) class that essentially holds the same data, and create mappings from the request to the DTO, and from the DTO to the database entity. And perhaps mappings for the other way around too, if you also want to be able to return those database entries to the user. So a DTO is more of a name for the purpose of the class, rather than aspects of what the class has or doesn't have like a pojo or javabean.
@TheJynx2011
@TheJynx2011 2 жыл бұрын
Good example of a DTO that I currently use is using one to store data in the database, and using the other to pull data via the API. The DTO is used to pull data so I don't potentially expose unnecessary information to the end user. The Entity, however, can store more information in the DB, without potentially exposing that information to the end user.
@vignesh3184
@vignesh3184 2 жыл бұрын
Can you explain why entity class need to be serializable?
@TheJynx2011
@TheJynx2011 2 жыл бұрын
@@vignesh3184 I believe its so the object is recreated the same, regardless of the target. That is, if you serialize a Java object, any other language can deserialize the object and receive the information. Could be incorrect or missing info, but that seems to be the application.
@pablog5738
@pablog5738 2 жыл бұрын
@@vignesh3184 entity classes don't need to be serializable
@anmjubaer
@anmjubaer Жыл бұрын
Thanks a lot for all the extra very important infos related to better understand POJO.
@Xim9600
@Xim9600 2 жыл бұрын
Nice video, very simple! thanks!
@Denys.Stoianov
@Denys.Stoianov 2 жыл бұрын
Thank you for this video. Clear explanation
@dilln2158
@dilln2158 3 жыл бұрын
I sugguest you do a java sudoku solver tutorial. It’s a common lab assignment in data structures and algorithms from what I’ve been hearing.
@CodingWithJohn
@CodingWithJohn 3 жыл бұрын
I wrote one in Python in college years ago actually, but haven't in Java yet. If I can make it concise enough for KZbin that's a great idea!
@CodingWithJohn
@CodingWithJohn 3 жыл бұрын
Figured it out, and it's this week's video. Thanks for the suggestion, hope you like it! kzbin.info/www/bejne/o5S7lGuDq8ZlmKM
@hajajssss3147
@hajajssss3147 Жыл бұрын
Thanks. Video was good and helpful
@amarnathvadivelu
@amarnathvadivelu 2 жыл бұрын
John thanks very much.. I misunderstood for many years that POJO and Java Beans are same. May be if i had found your channel earlier i would have even started loving Java earlier than this.
@zeeshanalam4914
@zeeshanalam4914 2 жыл бұрын
Clear, precise and straight to the point!
@pablog5738
@pablog5738 2 жыл бұрын
And wrong.
@dronephone9934
@dronephone9934 2 жыл бұрын
@@pablog5738 care to correct any points he made ?
@pablog5738
@pablog5738 2 жыл бұрын
@@dronephone9934 pojo refers to java clases that do not depend on any infrastructure apart from the core java language (string, list, map and such). Any class that has a dependency on, for example, a specific framework (ejb) or specification (a servlet) is not a pojo. If you have a domain in your project you may decide to implement it using pojos. That does not forbid using another class in your domain as a dependency, for example though inheritance. If in your domain there in a concept "animal", you can have a class "Animal" and a class Cat extends Animal, both being pojos. Please read about the origin of the term from Fowler (martinfowler/bliki/POJO.html)
@sanjibeatsan
@sanjibeatsan 3 ай бұрын
Great explanation
@saikiran3009
@saikiran3009 2 жыл бұрын
Great Explanation.
@metrocartao
@metrocartao 2 жыл бұрын
Excellent very clear!
@misterdneh
@misterdneh 11 ай бұрын
I searched what is a Java Bean something new I learned even though I self taught myself Java 10 years ago, and still don't know what a Java Bean is lol, I've come across your content before however very well explained.
@dejanpavkovic
@dejanpavkovic Жыл бұрын
Thanks John.👌
@user-lv5ck6zz9o
@user-lv5ck6zz9o 2 ай бұрын
thanks for this video!
@manojpal8337
@manojpal8337 Жыл бұрын
Nice Explanation !! Can we Modify the POJO Class based on the properties file? I am trying to add/inject/remove properties files fields in my POJO class from a property file. Is it possible?
@heartoutloud7498
@heartoutloud7498 Жыл бұрын
Damn man this was awesome. Thank you.
@MrWigen
@MrWigen 2 жыл бұрын
Well done :) Thank you
@mariolamenzaperello3774
@mariolamenzaperello3774 7 ай бұрын
Hello John, I would like you to explain why it is necessary to make the attributes private.
@christopherprobst-ranly6284
@christopherprobst-ranly6284 2 жыл бұрын
Funny, according to your def. a JavaBean cannot be a POJO because a POJO cannot implement an interface but JavaBeans have to implement Serializable. Gotcha :D You just have to love Javas consistency
@jarlfenrir
@jarlfenrir 2 жыл бұрын
Java bean cannot be a pojo, true, where is that 'gotcha' part?
@johnkeck
@johnkeck 2 жыл бұрын
I noticed that too. My question for @CodingWithJohn: does it cease to be a POJO because it implements another class, or because it implements an *outside* class? Serializable is a built-in Java class.
@jarlfenrir
@jarlfenrir 2 жыл бұрын
@@johnkeck I would say bean is not a pojo simply because it's a bean. Class has to fulfill some requirements to be a bean, while pojo does not follow any requirements of any framework.
@drcl7429
@drcl7429 Жыл бұрын
@@johnkeck serializable is an interface.
@TheFoxfiend
@TheFoxfiend 2 жыл бұрын
Thanks, a piece of maybe useful information that I can't bring up in an interview without sounding like a knowitall.
@RealRogerFK
@RealRogerFK 2 жыл бұрын
Thank god I now have this hidden knowledge critical for an efficient workflow.
@dexterdenmark5988
@dexterdenmark5988 2 жыл бұрын
Great man you are!
@johnlee8840
@johnlee8840 Жыл бұрын
Finally somebody explains it in layman’s terms for novices like myself. Thank you!
@09864473131
@09864473131 2 жыл бұрын
Thank you, Sensei
@stephenweber33
@stephenweber33 2 жыл бұрын
POJO Plain Old Java Object. Thank you, Started in 1983 programming, no schooling, just hobby. Missed a bunch of history. I remember putting a dot on a blank screen and it was brilliant, amazing, awesome. ;)
@slowstarter5720
@slowstarter5720 2 жыл бұрын
Or what if we use Lombok getter, setters annotations on a pojo. Can we call it as PoJo..? If we create no args constructor and getters and setters does it still qualify as PoJo?
@MD90X
@MD90X 2 жыл бұрын
that guy made a fancy sounding name for a simple java object so prudes would use it more, love it.
@wristdisabledwriter2893
@wristdisabledwriter2893 3 жыл бұрын
Great video. I was going to ask if a Java bean can be a pojo but you answered that when you typed implements serialize. Speaking of which, if you haven’t already, can you do a video on serialize
@CodingWithJohn
@CodingWithJohn 3 жыл бұрын
Yep, the implements Serializable is kind of a gray area because of what you're talking about. Lots of people will say that all Java beans are pojos, but not all pojos are Java beans. But technically the Serializable thing makes that not true. But in this case, Serializable is such a "built-in"Java functionality that many overlook that and still call them pojos, which is definitely understandable. You seem to have a keen eye for these types of subtleties in these videos! And I'll look into what a video on serialization might be like to see if it'll work.
@jarlfenrir
@jarlfenrir 2 жыл бұрын
I'd say java bean cannot be a pojo. Definition of POJO I learned was that POJO is basically a class that has no other fancy name. So if you can call it a bean, you no longer can call it a pojo.
@srinath.s
@srinath.s 2 жыл бұрын
What if class Implements Serialization?? Will we still refer to that class as POJO?
@slowstarter5720
@slowstarter5720 2 жыл бұрын
What about a class has everything else (like private fields, getters and setters and public no args constructor) but. Doesn't implement serializable.. ? Can we call it as PoJo or is it still a Java bean?
@joaopedrorocha5693
@joaopedrorocha5693 Жыл бұрын
Great explanation! But what is a Java Bean and what does it serve?
@venkateshmarneni385
@venkateshmarneni385 2 жыл бұрын
Pojo can implement and extend interface or classes of java
@damnseagulls2004
@damnseagulls2004 9 ай бұрын
AMAZING!!!!👍
@anitaliberatore2272
@anitaliberatore2272 2 жыл бұрын
Can you do a video about dependency injection?
@aszriel_
@aszriel_ 2 жыл бұрын
Well well, that's funny, I just discovered that I didn't know either what was a POJO. I'm currently in a training session and I asked if POJO and java beans were the same and unfortunately I got the "yes" anwser. But I was, somehow, skeptical, because why would we use 2 differents terms for EXACTLY the same thing ? Well now I know, they are not the same ^^ nice video.
@dawitadmassu2947
@dawitadmassu2947 2 жыл бұрын
My super man bro... do you have anything about Spring ? please please... You are my lifesaver ...
@leejojose
@leejojose 2 жыл бұрын
Awesome 👏👏👍🙏
@soumyadeepdebnath6623
@soumyadeepdebnath6623 2 жыл бұрын
As usual....John is a legend 🙌 👏
@Coccoutube
@Coccoutube Жыл бұрын
Hi John, can you please explain a little bit more what do you mean when you said a POJO mustn't use external libraries? For instance, if I used CollectionUtils from apache library inside the class, that would make my class NOT a POJO, right?
@drcl7429
@drcl7429 Жыл бұрын
correct.
@pecan8470
@pecan8470 2 жыл бұрын
thanks!
@shady5063
@shady5063 Жыл бұрын
Can you make a video about Jackson library?
@shadowcrafter01
@shadowcrafter01 2 жыл бұрын
When you were talking about the Cat class not being a Java Bean you said that the String and int were not private. Aren't variables private by default unless specified otherwise?
@kupotaro164
@kupotaro164 2 жыл бұрын
Default is package-private, so the fields can still be accessed by other classes in the same package.
@joaquimucolore3230
@joaquimucolore3230 2 жыл бұрын
Love the explanation, now I understand well the difference between javaBeen and Pojo.
@pablog5738
@pablog5738 2 жыл бұрын
The explanation is wrong.
@NilakshMalpotra
@NilakshMalpotra 2 жыл бұрын
@@pablog5738 What is wrong?
@pablog5738
@pablog5738 2 жыл бұрын
A pojo can extend other class and a pojo can implement an interface. The fundamental aspect of a pojo is that a pojo does not depend on any external component, in particular framework components like ejb or hibernate. It can depend on other classes that belong to the same domain. Cat extends Animal {} is a pojo if Animal is defined in the same package as Cat. But if you are using a 3rd party library that introduces Animal to your application, then Cat is not a pojo. The idea of pojo is that you can express your domain using classes that only depend on other classes of your domain. The idea of pojos appeared after ejb 1, that forced you to extend from ejb classes to implement your domain entities. It made your domain a mess, forcing your domain classes to implement behaviour imposed by a framework. With pojos your domain is cleaner, implementing domain specific behaviour, and the framework related behaviour moved outside the domain.
@joaquimucolore3230
@joaquimucolore3230 2 жыл бұрын
@@pablog5738 ohh thank you.
@baloney_sandwich
@baloney_sandwich 2 жыл бұрын
john can u slam your ad at the end of the vid? thanks. Quality video nevetheless.
@Gandhi_Physique
@Gandhi_Physique 2 жыл бұрын
So, if I make a Calculator class and create simple methods for each operation, then it is a POJO? An example: The class: public class Calculator A method: public static void add(double num1, double num2) { System.out.println(num1 + num2); }
@jarlfenrir
@jarlfenrir 2 жыл бұрын
Guess technically yes, that's a pojo, but because it has no fields and only a static method, many people would call it a "helper class".
@devjena8924
@devjena8924 2 жыл бұрын
Please make some videos on spring boot
@eduardmart1237
@eduardmart1237 2 жыл бұрын
Make a video about spring
@doekewartena5729
@doekewartena5729 2 жыл бұрын
I hate private, to many times I have to rely on reflection to do things to do the things I want. Also I think in most cases something should be protected over private. But what do I know...
@ALLINONE-ck1ef
@ALLINONE-ck1ef 9 ай бұрын
Can pojos be serializable?
@josbexerra8115
@josbexerra8115 2 жыл бұрын
Gracias Mister John....claro y directo al punto.....saludos de los andes peruanos
@Mahmudulhasan-ts5hm
@Mahmudulhasan-ts5hm Жыл бұрын
Thanks
@omegapirat8623
@omegapirat8623 2 жыл бұрын
How can a java bean be a POJO if a java bean depends on the serializable interface?
@Zero-4793
@Zero-4793 2 жыл бұрын
I only use POJO so far as i've not learnt the other stuff yet XD. havent had a need to yet with my projects
@munagalavrr
@munagalavrr 2 жыл бұрын
Two corrections for Java Bean: 1. Fields don't need to be private -2. Getters & Setters are not required for a class/object- These requirements are do's and don'ts from some design patterns or recommendations. Not part of bean definition.
@drcl7429
@drcl7429 Жыл бұрын
as per the Oracle spec there must be getters and setters. "Properties are always accessed via method calls on their owning object. For readable properties there will be a getter method to read the property value. For writable properties there will be a setter method to allow the property value to be updated. Thus even when a script writer types in something such as “b.Label = foo” there is still a method call into the target object to set the property, and the target object has full programmatic control."
@munagalavrr
@munagalavrr Жыл бұрын
@@drcl7429 Following those lines in the spec: "So properties need not just be simple data fields, they can actually be computed values". Irrespective internally how java invokes/compiles, getters & setters are not required to define a bean. From newer Java standards, "record" is perfectly valid Java Bean even though it doesn't have any methods.
@drcl7429
@drcl7429 Жыл бұрын
@@munagalavrr As far as I know, no further spec beyond 1.01 was published by Oracle, Sun or JavaSoft.
@munagalavrr
@munagalavrr Жыл бұрын
@@drcl7429 Sorry, you are correct, thanks for correcting me. I have updated my original comment.
@alontalmor6942
@alontalmor6942 2 жыл бұрын
Is using an external class possible in a POJO class? For example, If the POJO class uses Map or List from the java.url lib or having a field with a with a user defined class type.
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
Using standard libraries like that probably doesn't disqualify it from being called a "pojo". It's definitely worth noting though, that it's still a somewhat fuzzy definition. And don't let it stop you from using what you need to use in your class. Even if it might not be called a pojo anymore, having your application function properly and be coded in a clean way is a way bigger priority.
@alontalmor6942
@alontalmor6942 2 жыл бұрын
Thank you for the answer John! And in my comment I wrote java.url, I meant java.util of course.
@athul03
@athul03 11 ай бұрын
What about Jave Bean vs POJO vs Spring Bean?
@powertester5596
@powertester5596 Жыл бұрын
Master Shifu, your Java Kung fu is on another level 🙏. Please keep teaching! - from one of your many online students!
@sureshmanne7245
@sureshmanne7245 2 жыл бұрын
Can we implement toString() in POJO or Java Bean ?
@RutgerOlthuis
@RutgerOlthuis 2 жыл бұрын
Yes
@sureshmanne7245
@sureshmanne7245 2 жыл бұрын
@@RutgerOlthuis will it not break POJO terminology if we do so?
@RutgerOlthuis
@RutgerOlthuis 2 жыл бұрын
@@sureshmanne7245 You could even say it makes it more pojo. When you don't write your own toString method, you're inheriting it from java.Object class. The base class of all java classes. So by implementing it yourself, you're taking a bit of this inheritance away. And if you look at the rules for a pojo: you're not adding inheritance (no extends), you're not implementing an interface (no implements keyword) and you're not adding some external annotation kung-fu. @Override is no external annotation magic.
@ahmedmaatoug1108
@ahmedmaatoug1108 2 жыл бұрын
At end when you add implement serializable to make the class a java bean, doesn't this make the class not POJO anymore? Because the class is implementing something now
@alessioantinoro5713
@alessioantinoro5713 2 жыл бұрын
Yeah he answered that from another comment, he said: "serializzable is such a built-in java feature, that even if it is not a pojo, we sometimes call it so"
@lavnyaup
@lavnyaup 3 жыл бұрын
thanks for the explanation. I am confused between POJO and DTO. could you please help me understanding with a video if possible.
@iyhan1987
@iyhan1987 2 жыл бұрын
Since there is still no video here is the answer: POJO may contain not only properties, but also methods and logic, sometimes truly complicated. DTO stands for Data Transfer Object. It is used to send data from one module, service, application to another, 4 example via message brokers such as RabbitMQ. DTO contains only necessary data, no methods except may be getters and setters. As a very primitive example, you have class Employee, that contains a lot of information about the person: age, name, address, birthday, sex, bank account, salary etc. And also it has methods such as promote(), fire() and so long. When it is time to pay your worker you send information to another application, that actually pays the money. It doesn't need age, sex and phone number of employee. The only thing it does is sends money from your account to another one that you provide. So BOTH(!!!!) your application and the salary module have the same let call it PaymentDto class. That class only has bankAcconutNumber and salary properties. Otherwise the payment application should have the entire Employee class implemented to be able to receive data from you, automatically map it to own class and process one. PaymentDto is the object that you actually send from one module to another, creating it using only required data from your employee object. So it is an object that is used to transfer the data. Data Transfer Object. DTO.
@pt_trainer9244
@pt_trainer9244 2 жыл бұрын
@@iyhan1987 thanks for this. Been looking for a concise explanation
@iyhan1987
@iyhan1987 2 жыл бұрын
@@pt_trainer9244 you are welcome :)
@thirumalaisriram8623
@thirumalaisriram8623 Жыл бұрын
Great and simple video! Thank you :)
@lieutneautnacer
@lieutneautnacer Жыл бұрын
but while you written the word implements serializable you had broken the first rule!!! isnt that????
@findlestick
@findlestick 2 жыл бұрын
Nice.
@gabrielpereiramendes3463
@gabrielpereiramendes3463 2 жыл бұрын
#Excelent!
@VANTYCSolutions
@VANTYCSolutions 10 ай бұрын
Where were you all those years of confusion? 👏👏👏
@alexhu01
@alexhu01 2 жыл бұрын
If java bean has to implement serializable interface, does it mean it's no longer POJO according to your definition(POJO can't implement interfaces)?
@saranram9225
@saranram9225 2 жыл бұрын
He said bean class is not a POJO already
@alexhu01
@alexhu01 2 жыл бұрын
@@saranram9225 I think I missed it. about what time he said that?
@christopherprobst-ranly6284
@christopherprobst-ranly6284 2 жыл бұрын
@@alexhu01 He did not say it.
@phoneguy1015
@phoneguy1015 2 жыл бұрын
I notice that a java bean is not a POJO at all as it implements serializable, which breaks the rule of a POJO
@morrisbirkholz30
@morrisbirkholz30 2 жыл бұрын
So you say a class that extends a POJO can not be a POJO itself? I do not think that is correct.
@jarlfenrir
@jarlfenrir 2 жыл бұрын
I agree.
@sunilkumar-jc5vb
@sunilkumar-jc5vb 2 жыл бұрын
What is seariliable? Please make a video
@jarlfenrir
@jarlfenrir 2 жыл бұрын
Java has many builtin methods to write objects directly. For example you can pass a whole object to some socket or to file. Java checks if the object implements serialziable, and if so, it will convert it to some binary form that can be written to file, send via network or something. By writing "implements serializable" you are saying that this object can be safely stored and then reverted. For example if there is possibility of a cyclic dependency (A has reference to B, B references C and C references back to A) serialization of that object would get stuck on that so you should not mark that object as serializable.
@b005t3r
@b005t3r 2 жыл бұрын
I've been programming as a profession for over 15 years and never used that term or heard it being used.
@jarlfenrir
@jarlfenrir 2 жыл бұрын
I have similar experience and also must say this term does not come up too often. Generally if you read about some framework or library you are considering using and documentation says it works with POJO, that basically means you can pass any kind object you want to it and it will work.
@eshwarnag
@eshwarnag 6 ай бұрын
blow my mind always
@siddharth2291
@siddharth2291 Жыл бұрын
Please make a Spring Boot course.. I'll be the first person to buy it 🙏
@Ihavetoreturnsomevideotapes
@Ihavetoreturnsomevideotapes 2 жыл бұрын
Do a java Bean Video
@19891214ful
@19891214ful 2 жыл бұрын
Hey John, can a POJO contain an import statement? As I understand a POJO is a standalone, independent java class. So having an import statement makes it “NOT” POJO?
@asifnisarr
@asifnisarr 2 жыл бұрын
You forgot to explain what is the usage
@vimalathithan2007
@vimalathithan2007 2 жыл бұрын
I think the class Cat extends java.lang.Object . So cat class is not pojo. 😇
@iippari7
@iippari7 2 жыл бұрын
Would a class with a member with a non-JDK non-primitive type still be a POJO? Surely, that class couldn't be used by itself: you'd need the other class, as well
@Alex-mp5bu
@Alex-mp5bu 2 жыл бұрын
I think this definition is still made up. POJO, historically, is just an alternative to an Enterprise Java Bean. Not extending or implementing may have referred to EJB specific base classes and interfaces.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Vectors in Java: The 1 Situation You Might Want To Use Them
16:13
Coding with John
Рет қаралды 75 М.
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 1,2 МЛН
He tried to save his parking spot, instant karma
00:28
Zach King
Рет қаралды 17 МЛН
Spring ultimate basics: What are Spring Beans and what is the Spring Container?
16:30
HACKING UNITY GAMES (FOR NOOBS)
16:11
cazz
Рет қаралды 14 М.
Java Anonymous Inner Classes Explained in 6 Minutes
6:27
Coding with John
Рет қаралды 91 М.
Java Bean vs POJO vs Spring Bean | Are you confused too ?
6:29
in28minutes - Get Cloud Certified
Рет қаралды 60 М.
Java Polymorphism Fully Explained In 7 Minutes
7:16
Coding with John
Рет қаралды 289 М.
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 193 М.
Multithreading in Java Explained in 10 Minutes
10:01
Coding with John
Рет қаралды 867 М.
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 1,2 МЛН