Records In Java - Full Tutorial - The Best New Java Feature You're Not Using

  Рет қаралды 266,779

Coding with John

Coding with John

Күн бұрын

Пікірлер: 555
@Mahmoudalkasem1997
@Mahmoudalkasem1997 2 жыл бұрын
The best person on KZbin that explains java in such a great way
@pavelsakun2308
@pavelsakun2308 2 жыл бұрын
If you didn't see anyone better doesn't mean he is the best ;-) He is good anyway.
@Mahmoudalkasem1997
@Mahmoudalkasem1997 2 жыл бұрын
@@pavelsakun2308 this is my opinion and l am free to think whatever I want right ;)
@EternalBlaze10
@EternalBlaze10 5 ай бұрын
I prefer Telusko
@keionvergara7608
@keionvergara7608 2 жыл бұрын
you were the reason i got a 5 on my ap comp sci A exam!! you truly have impacted my education and taught me more than my highschool teacher did in 5 months !
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
Awesome, and congrats!
@Reichstaubenminister
@Reichstaubenminister Жыл бұрын
Funny, 5 would be an E in Germany. Had to think about that for a second.
@justinliu7788
@justinliu7788 Жыл бұрын
It’s 5/5
@ItIsJan
@ItIsJan Жыл бұрын
​@@Reichstaubenministersprach der reichstaubenminister
@Nanagos
@Nanagos 2 жыл бұрын
I recently found out about Records but there are just no good tutorials about it. I'm glad you made one now.
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
Thanks! Yeah there's surprisingly little out there so far. Probably just because it's pretty new.
@libertymedicalcommunicatio4908
@libertymedicalcommunicatio4908 2 жыл бұрын
Congrats on almost reaching 100K. This one should put you over the top.
@fisch37
@fisch37 2 жыл бұрын
You are correct!
@sukusukumar2413
@sukusukumar2413 2 жыл бұрын
Please take one class about scanner class..
@HasNoName69
@HasNoName69 2 жыл бұрын
Thanks
@arnddeshives147
@arnddeshives147 2 жыл бұрын
There is a lot of content like this out there, but you are so much better than the rest in terms of tempo, order, quality and presentation, thank you so much! I started studying CS half a year ago and your videos are 5x quicker at explaining the same thing than my prof. Although sometimes there is some depth missing, but it's good that your videos don't get lost in that, that's what makes it so good. Maybe it would be great if there was a playlist for in depth knowledge as well though.
@greatprogrammerhsin
@greatprogrammerhsin 2 жыл бұрын
please never stop making videos, these are so helpful!
@huskydreaming
@huskydreaming 2 жыл бұрын
I am advanced in java but it is great to see someone explain it so concise. Amazing explanation on these types of videos. Keep it up!
@xugefu
@xugefu 2 жыл бұрын
Thanks!
@shankar7435
@shankar7435 2 жыл бұрын
Never thought learning Java would be such a pleasure. A decade ago, I was frustrated with the Java Reference book and left learning java and continued with my day job in DB language. Now, I am learning java without any issues with the help of youtube. Thanks to the youtube community.
@AherinDOTA
@AherinDOTA 2 жыл бұрын
Thanks
@BkSMedia
@BkSMedia 2 жыл бұрын
I've been learning Java in my CS degree for the last three years, I had no idea records were a thing!!! So cool!
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
Yep! They're a relatively recent addition.
@leeamraa
@leeamraa 2 жыл бұрын
Quality, effective, efficient and much appreciated content.
@iCybqr
@iCybqr 2 жыл бұрын
Could you do a video on Consumer, Predicate, and Supplier? I mostly understand what they do, but not when to use them.
@YtubeUserr
@YtubeUserr Жыл бұрын
if you are reading this John, please make this video happen! Thanks!
@pclclau
@pclclau 2 жыл бұрын
At 5:00 you mention that Java generates a default, no-arg constructor *even if* you don't create other constructors. That isn't quite true, Java creates a no-arg constructor *only if* you don't create other constructors. This is why your fields get red underlines as soon as you manually create the no-arg constructor, because there would be a way to have final fields that aren't initialized as soon as the object is created. Before you manually created the no-arg constructor this wasn't a problem, because Java wouldn't generate one since you already had the previous one created.
@eufraniodiogo50
@eufraniodiogo50 2 жыл бұрын
That's absolutely true, maybe it was just a runtime exception(subclass of Exception) at his speech. lol
@KaraSuraDraw1
@KaraSuraDraw1 2 жыл бұрын
I don’t get what you mean. I feel like your comment just justified what he said. Or do you think he meant even if you have other constructors Java always generates a default no-arg constructor? I think he just put it there for visuals of a no-arg constructor. Because i got that what you said from the video.
@pclclau
@pclclau 2 жыл бұрын
@@KaraSuraDraw1 He said that Java provides a no-arg constructor no matter what constructor you already have definded. That's not true.
@alfasolarenergy
@alfasolarenergy 2 жыл бұрын
When you create an object of the Class two things happes: 1. MEMORY IS ALLOCATED, 2. THE CONSTRUCOR IS CALLED. By default Java offers a 0 argument construcotrs which are 0 for numeric types, and false for boolean and null. The moment we create our impemtation of constructor ( a constructor which initialize fields) the 0 arg one is no longer called.
@TechiiEngineer
@TechiiEngineer 2 жыл бұрын
True , if you have created just an args-constructor ; You cant created object as : new Employee(); That means Employee class doesn’t have no arg constructor ; You have to create one.
@sameersafi6128
@sameersafi6128 2 жыл бұрын
The way of teaching is totally different.. thank you so much for the deep knowledge that you are sharing... kindly make tutorial on stream api in future
@argonwheatbelly637
@argonwheatbelly637 Жыл бұрын
Guitars 🎸, drums 🥁, and programming. 💻 Yep! You're definitely part of my tribe. Excellent video! Keep it up.
@rohitsharma-xt8qe
@rohitsharma-xt8qe 5 ай бұрын
This is something new for me and this video has full of information, every single sec is worth it, Thanks John 😊
@chenchi6623
@chenchi6623 Жыл бұрын
I like the style of teaching, very clear examples and no bs, earned a sub...
@pradiptaspointofview1475
@pradiptaspointofview1475 2 жыл бұрын
Explained quite clearly with detailed examples. Excellent tutorial! This is what I needed to start working with Records in Java.
@mohammadsadeghsheikhzahedi3682
@mohammadsadeghsheikhzahedi3682 Жыл бұрын
You are perfect 👌
@nishantsirwani3812
@nishantsirwani3812 2 ай бұрын
Very elaborate and to the point explanation, thank you!
@ArjunKumar-zu2kl
@ArjunKumar-zu2kl 6 ай бұрын
Just wow John, you are awesome. Clear voice. Thank you so much...
@pandirajan1991
@pandirajan1991 2 жыл бұрын
Thank you
@ShreyasS-bn9lm
@ShreyasS-bn9lm 5 ай бұрын
Hey man, this tutorial on Java Records is good! You broke it down so clearly, the basic parts makes sense. Thanks a lot for this awesome content! Edit : Understood 50% of he video clearly and the rest 50% a little bit....revisiting Java...and Learning..
@eperrone
@eperrone 2 жыл бұрын
Not a Java developer but I have to read Java and Groovy all the time. Your videos are great background to help me understand what I’m looking at. Great stuff.
@饶泽海
@饶泽海 6 ай бұрын
Thank you John! You structure your videos exceptionally well and have a very clear explanation style
@raz0229
@raz0229 2 жыл бұрын
You are so underrated! Hope you reach 1 mil subs soon
@tuna5395
@tuna5395 2 жыл бұрын
Thanks bro you helped with my project !
@lucashenrique6076
@lucashenrique6076 2 жыл бұрын
Thanks for the Video John! Greetings from Brazil 😉
@isbdd97
@isbdd97 2 жыл бұрын
great lesson as always , grettings from Morocco
@sandunicula6185
@sandunicula6185 2 жыл бұрын
Great presentation! Thanks!
@AbdelhameedGamal-ki7th
@AbdelhameedGamal-ki7th Жыл бұрын
So simple and clear explanation. I really appreciate your help.
@ccmawil20
@ccmawil20 2 жыл бұрын
Explanation is clean and clear. please publish more videos like this. Thanks
@emilmathew2257
@emilmathew2257 9 ай бұрын
Have been following your videos for a while now. Thank you for the awesome content 😊
@alexornwara3182
@alexornwara3182 2 жыл бұрын
I cannot believe I completed many courses and projects in Java without using this 😔🤯 My goodness, think of the time I could've saved! Thank you for making this video. It's so engaging, informative, and very easy to understand.
@yaroslavpanych2067
@yaroslavpanych2067 8 ай бұрын
That means, that this stuff is not really important. It is not a unique cure to any problem you had.
@simonrozendal7542
@simonrozendal7542 2 жыл бұрын
Hi John. Even when i write Java programs quite a while, i still learn new thing from you. Thank you, you are presenting good Java content. Kind regards, Simon Rozendal.
@DMoots
@DMoots 6 ай бұрын
Thanks John, this video really set the Record straight for me!
@maneshipocrates
@maneshipocrates 2 жыл бұрын
Thanks alot John. This talk should be included in the official doc.
@RamGorre
@RamGorre 2 жыл бұрын
That's an awesome no BS explanation. Too good.
@mastershonobi110
@mastershonobi110 2 жыл бұрын
Thanks John!!! Always looking for ways to improve and writing clearer/better code.
@mastershonobi110
@mastershonobi110 2 жыл бұрын
Side Note…are you using Java 17 or 16? B/c “records” is not supported in Java 11.
@Wallasmod
@Wallasmod 2 жыл бұрын
Excellent video
@budiardjo6610
@budiardjo6610 11 ай бұрын
after i am learning about memory management, stack and heap and jvm internals i could really understanding this properly what a powerfull feature
@bischoffdev
@bischoffdev 2 жыл бұрын
I thought I knew all about records (and I am using those extensively) but this is the first time I heard about the compact constructor! Thanks a lot!
@frankjuuh
@frankjuuh 2 жыл бұрын
Love you, John. Best teacher.
@sijanbhandari7569
@sijanbhandari7569 2 жыл бұрын
Thanks for teaching me more about records, I was always teaching my fellow programmers about this in my workplace.
@EmpySoul
@EmpySoul 4 ай бұрын
People like you make much easier to live in the Software Engineering world :)
@mustapharaimilawal8053
@mustapharaimilawal8053 9 ай бұрын
Thanks a lot for doing this tutorial. Clear, easy to follow explanation as always.
@nischalofchrist
@nischalofchrist 2 жыл бұрын
Thank you, I've always wanted to learn about Records.
@antonkimberg8914
@antonkimberg8914 2 жыл бұрын
Hi John, Thank you for your superb content. Me and other group of people from Estonia are learning Java and your channel helps us to understand hard material in a simple way. Could you please make a video tutorial about streams in future? Thank you in advance, Tony
@longtran12345678
@longtran12345678 2 жыл бұрын
your videos really help me to focus on Java again :)
@KarolKasperek
@KarolKasperek 2 жыл бұрын
u have the best java keyword's tutorials, ty
@hakkcancakmak6275
@hakkcancakmak6275 2 жыл бұрын
Thanks for this video
@fazithfouseen1548
@fazithfouseen1548 2 жыл бұрын
Hi John, Please upload Microservices and spring boot tutorials as well
@givemepepsipls536
@givemepepsipls536 2 жыл бұрын
he best person on KZbin that explains java in such a great way
@FLStudioTutorialz
@FLStudioTutorialz 2 жыл бұрын
Awesome. Thanks.
@Speiger
@Speiger 2 жыл бұрын
Looks like Records are like Lombock. I assume they have the same pitfalls you can run into if you are not careful. But this tutorial was really nice, I haven't touched these yet, but i see for myself already tons of usecases for this. Especially for like singleton function classes, where you have your builder and then the object that executes said code. Keep up the work!
@hellowill
@hellowill 2 жыл бұрын
It's not as powerful as Lombok unfortunately
@Speiger
@Speiger 2 жыл бұрын
​@@hellowill But it does not have the same critical performance pitfalls like Lombok has. And to give context. In a performance sensitive context lombok has the ability to destroy your performance just based on how the variables are compared in a hashcode/equals function where the order can be important.
@hellowill
@hellowill 2 жыл бұрын
@@Speiger Ah right. I guess I dont focus too much on performance critical workloads. I do wish records had better support for builders or so called 'withers'.
@Speiger
@Speiger 2 жыл бұрын
@@hellowill Lets put it that way. For people who use lombok its not a great option. For everyone else it is a good way to reduce code and it does reduce the Licensing hell.
@emanueltrandafir8756
@emanueltrandafir8756 2 жыл бұрын
@Speiger, @Will - I personally believe java records and lombok are different features that can be used for different things. Records are similar to Lombok's @Value classess, indeed - but Lombok has a lot of other features to offer and it allows much more flexibility.
@Jody-nf2bz
@Jody-nf2bz 2 жыл бұрын
Very well explained, readable size text, excellent class! Thank you!
@B-Billy
@B-Billy Жыл бұрын
That's a really good teaching... Thanks 🎉
@shivk498
@shivk498 2 жыл бұрын
Java is usually known for its cumbersome syntax but such awesome improvements like records would make java lovers more excited.
@cverde1234
@cverde1234 2 жыл бұрын
This is really similar to records in C#. We don't have compact constructors though. I think compact constructors are really neat.
@hunelysium
@hunelysium 2 жыл бұрын
Hello John, it's always great to listen to your explanations on Java! Thank you for your valuable wisdom!! On a side note, noticed your voice and the way you talk has changed since you become a father :) Hope you and your family well during this different times! Keep making thus great videos, always love watching them!
@jaspreet821
@jaspreet821 Жыл бұрын
Great episode my man!! 😮😮
@jimjimjimjimjim6572
@jimjimjimjimjim6572 2 жыл бұрын
Nice pace, and super clear, cheers my man
@vladimirspasov5591
@vladimirspasov5591 2 жыл бұрын
Great explanation
@olivierbegassat851
@olivierbegassat851 Жыл бұрын
Your exposition is always so direct and simple. I love it 🙂
@mohamedsaleh5970
@mohamedsaleh5970 2 жыл бұрын
You helped me understand concepts that was difficult to understand on my own.
@RicardoSilvaTripcall
@RicardoSilvaTripcall 2 жыл бұрын
Great explanation !!! Congrats ....
@sanuretaroro3281
@sanuretaroro3281 2 жыл бұрын
Your explanation is beautiful
@MortenSlottHansen
@MortenSlottHansen Жыл бұрын
Nice and precise explanation without any fuzz 🎉
@tanacing347
@tanacing347 8 ай бұрын
Gracias John!!!
@Markki28
@Markki28 2 жыл бұрын
awesome as always, thank you for sharing man, I am familiar with records but I'm not aware that I can do specific field validations directly into it, that's very useful thanks man
@ayberkctis
@ayberkctis 2 жыл бұрын
Hey John! If i knew Records before, i would use them in my previous task in my company because they fitted my task perfectly! Thank you for your effort :)
@BillyCha00
@BillyCha00 2 жыл бұрын
Hi John, you are the best!! please upload Microservices and spring boot tutorials :)
@electricant55
@electricant55 2 жыл бұрын
Except for that neat overriding constructor, it seems like Lombok is still a more useful option, unless you can put annotations on the fields declared in record for things like JPA or JSON serialization
@Darya-pu6ik
@Darya-pu6ik 2 жыл бұрын
what is Lombok?
@ThiagoHenriqueDS
@ThiagoHenriqueDS 2 жыл бұрын
@@Darya-pu6ik It's a library that allows you to use annotations in order to create things like getters, setters, equals methods, etc. For example, instead of write getters and setters you just use the annotation @Data, @Getter or @Setter above a constructor: @Getter @Setter public Car(String color, String name) { }
@Darya-pu6ik
@Darya-pu6ik 2 жыл бұрын
@@ThiagoHenriqueDS thanks, looks helpful!
@shivk498
@shivk498 2 жыл бұрын
Lombok is indeed very useful but it still a third party plugin. Java is usually known for its cumbersome syntax but such awesome improvements like records would make java lovers more excited.
@pavelsakun2308
@pavelsakun2308 2 жыл бұрын
Seeing comments like this makes me think other devs are spending a lot of time to generate POJOs/DTOs and that's hardly true. That kind of objects is being written once and the rest 99+% of time is spent for writing business logic, so even with what vanilla java and IDEs are providing I do not see HUGE problem of implementing them without record/lombok. The only exception here is readability, but...do you really often open classes named '*DTO" for reading? I really doubt.
@ignition-ai
@ignition-ai 2 жыл бұрын
Hi i am a french student , we started the poo this week , i think this vidéo gonna help me 😄
@anantharamu80
@anantharamu80 2 жыл бұрын
Love this. Very informative.
@andres98
@andres98 2 жыл бұрын
I was waiting for this video so badly :))
@nokiababai2407
@nokiababai2407 2 жыл бұрын
Hi dude, please do a series on java streams. This records are very crystal clear thanks
@MrLuMax5
@MrLuMax5 2 жыл бұрын
Great video. Especially for those who know the basics and are interested in new Java Features after J11. Keep these up!
@RahulSingh-qe4sw
@RahulSingh-qe4sw 2 жыл бұрын
Thank you so much , explaination was very nice.
@Atom-Mercury
@Atom-Mercury Жыл бұрын
Very well explained. Thank you kindly.
@Naimadmdp
@Naimadmdp 2 жыл бұрын
Nice content mate, thanks for share!!!
@katisbetter2952
@katisbetter2952 2 жыл бұрын
Keep up with the good work, you’re helping a lot of people 🙏🏻
@mandarkawtakwar9732
@mandarkawtakwar9732 8 ай бұрын
This is like Case Class in Scala... Finally Java has it.
@PratikKumar42
@PratikKumar42 2 жыл бұрын
Great video, these really helps alot.
@ayed-al-nator
@ayed-al-nator Жыл бұрын
Beautiful video 💚 thank you 😊
@chacha-bm4jc
@chacha-bm4jc 2 жыл бұрын
Thanks a lot John! Would be there any video about sealed classes? It is also quite cool feature
@kirankumarsukumar
@kirankumarsukumar 2 жыл бұрын
Omg. You are so amazing at teaching. Thanks Master Yoda
@andressolano7979
@andressolano7979 4 ай бұрын
Mil gracias amigo!
@darkworld8544
@darkworld8544 2 жыл бұрын
Hi John thank Q for ur valuable information sharing love from India 🇮🇳
@TakeshySun
@TakeshySun 2 жыл бұрын
@ Coding with John , Hi, could you please record a video about Java 8 features like Optional and Streams. It will be so wonderfully. And big thank you for short and really useful videos!
@mahmoudelwsef8752
@mahmoudelwsef8752 Ай бұрын
الله ينور عليك ي جنجون ي اخويا
@johnkeck
@johnkeck 2 жыл бұрын
This is great! I learned a lot from this video. But it left me wondering which versions of Java have records. Also, what about records that have many fields? Are records compatible with the builder pattern recommended for constructors with more than four or so parameters? Keep up the good work, John!
@vijaykumarreddyt3287
@vijaykumarreddyt3287 Жыл бұрын
First question, answer is java 16
@matiasmoresi5040
@matiasmoresi5040 2 жыл бұрын
Mindblown by this feature!
@randomuserrandom8613
@randomuserrandom8613 2 жыл бұрын
Thank you so much. This was very helpful and the way you explain things makes it so easy to understand them. Keep up the good work, John!
@Ross-sg3hq
@Ross-sg3hq 2 жыл бұрын
Hello, John! Greetings from Ukraine! Wanted to say thank you for awesome lessons
@raoufbenabdelwahed6362
@raoufbenabdelwahed6362 Жыл бұрын
well explained as usual !
@JorgetePanete
@JorgetePanete 2 жыл бұрын
Perfect tutorial, much appreciated!
@jaimesastre6393
@jaimesastre6393 2 жыл бұрын
really cool!!! Spring had some simplification, but here it's much better and has also interesting options! Thanks 👍👍
@Giorgi.Japiashvili
@Giorgi.Japiashvili 2 жыл бұрын
What do you mean by the Spring simplication?
@hbfl3x50
@hbfl3x50 Жыл бұрын
Very informative 👏
Optionals In Java - Simple Tutorial
15:53
Coding with John
Рет қаралды 226 М.
Ranking Java Features Added from Versions 8 to 21!
27:03
Tales from the jar side
Рет қаралды 7 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Static vs Non-Static Variables and Methods In Java - Full Simple Tutorial
11:29
Array vs. ArrayList in Java Tutorial - What's The Difference?
17:36
Coding with John
Рет қаралды 575 М.
Java Reflection Explained - bɘniɒlqxƎ noiɟɔɘlʇɘЯ ɒvɒᒐ
17:50
Coding with John
Рет қаралды 196 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1,1 МЛН
Java Strings are Immutable - Here's What That Actually Means
7:06
Coding with John
Рет қаралды 627 М.
Best of CES 2025
14:50
The Verge
Рет қаралды 638 М.
Lambda Expressions in Java - Full Simple Tutorial
13:05
Coding with John
Рет қаралды 792 М.
Record Classes in Java | Java 17 features
16:02
Telusko
Рет қаралды 70 М.
Java Custom Exceptions Tutorial - It's Way Easier Than You Think
14:29
Coding with John
Рет қаралды 172 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН