Static vs Non-Static Variables and Methods In Java - Full Simple Tutorial

  Рет қаралды 157,623

Coding with John

Coding with John

Күн бұрын

Struggling with static vs nonstatic in Java? You found the perfect video!
☕ Complete Java course: codingwithjohn.thinkific.com/...
For beginner Java programmers, the concept of static vs nonstatic fields and methods can be incredibly confusing. I know it was for me!
But it doesn't have to be difficult. We'll go over EXACTLY what the difference is, how they're used, and when you should make your methods and fields static or nonstatic in your programs.
Learn or improve your Java by watching it being coded live!
Hi, 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 learners.
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
📹Camera I use for recording:
amzn.to/3wlXcmR
🎙️Microphone I use (classy, I know):
amzn.to/3AYGdbz
Donate with PayPal (Thank you so much!)
www.paypal.com/donate/?hosted...
00:00 What Non-Static means
03:34 What Static means
05:53 Why can't I access my Non-Static variable?
08:42 Using Static for Constants
10:30 When to make something Static or Non-Static?
☕Complete Java course:
codingwithjohn.thinkific.com/...
codingwithjohn.com

Пікірлер: 232
@a7mdbest15
@a7mdbest15 4 ай бұрын
Anyone wants to learn java, this is the destination
@gunnerxt
@gunnerxt 9 ай бұрын
Hey John, I truly appreciate the way you explain concepts. There's one aspect I'd hope you cover: Serialization and Deserialization. Thank you for keeping up the good work. You make so many people want to code
@neon0wl2107
@neon0wl2107 9 ай бұрын
1:52 cleared a doubt i have been having for over 5 years. Thanks a lot.
@micleh
@micleh 9 ай бұрын
Just in the nick of time. My students are presently struggling with static and non static and this video might help them look at both concepts from yet another angle. Thanks again for your short but incredibly succinct videos.
@kingslymatthew5586
@kingslymatthew5586 9 ай бұрын
Your contents are easy to follow & understand. Thanks John.✌🏼
@akshitmittal1251
@akshitmittal1251 24 күн бұрын
U have very POSITIVE vibe. There are v less people like u. Thanks for all tutorials
@timmann109
@timmann109 9 ай бұрын
Best description I have seen on this topic. Thanks
@olivierbegassat851
@olivierbegassat851 9 ай бұрын
Those explanations are crystal clear ... You are an amazing teacher, and those lessons are invaluable 😃
@jessicar5549
@jessicar5549 8 ай бұрын
John. I just need to say I am so thankful I’ve run across your channel. Thank for educating us all!!!
@matiloki
@matiloki 5 ай бұрын
My goodness, years using it without knowing how to explain this to other people. Now I can teach it. Thanks!!!
@AdrianTregoning
@AdrianTregoning 9 ай бұрын
Pure gold, that made it easy to understand. Thanks John.
@sgretsch
@sgretsch 8 ай бұрын
These lectures are the best ones that I've seen on the Internet, even compared with L/U big monsters. Not only knowledge, but hidden rocks that you can collide with, everything explained. Thanks to the author!
@Hassan-lv9di
@Hassan-lv9di 7 ай бұрын
Simplicity, straight forward, depth.. yep that's CodingWithJohn ! I love you man! KEEP UP THE HARD WORKING
@tshepisoseabi1069
@tshepisoseabi1069 2 ай бұрын
You have no idea how long I've been struggling to understand this, thank you John.
@GabrielLima-yq6qp
@GabrielLima-yq6qp 9 ай бұрын
how did you know that i needed this video? your content is so amazing keep going
@CodingWithJohn
@CodingWithJohn 9 ай бұрын
I have eyes everywhere 👀
@erikseyranyan5490
@erikseyranyan5490 6 ай бұрын
Love you bro. You are the best teacher. Understand your videos are very easy your methods of teaching are the best@@CodingWithJohn
@muhammetalimutlu6748
@muhammetalimutlu6748 5 ай бұрын
@@CodingWithJohn mr you are great thank you
@LANternFly1001
@LANternFly1001 3 ай бұрын
@@CodingWithJohn I pray for your codiness Saint John.
@yte6598
@yte6598 9 ай бұрын
Finding your channel is luck for me! I had avoided to learn Java because of difference from any other language and stream of fearful keywords. But thanks to your teaching that anyone can understand and well-made examples in your videos and courses, I could understand what mean of keywords and how to code in Java. Not only that, I find attraction of Java and enjoy coding with it! I sincerely hope to see your videos more. Thanks!
@magadiflo-dev
@magadiflo-dev 9 ай бұрын
He really has a simple and very understandable way of explaining these concepts. Thank you very much for sharing them. Greetings from Peru
@andyhicks3472
@andyhicks3472 5 ай бұрын
This is the clearest explanation of static I have come across. Thank you!
@raderadovanovic9052
@raderadovanovic9052 9 ай бұрын
Very nice explanation. Keep up with a good work John!
@SupahBro535
@SupahBro535 2 ай бұрын
Java was the one language I was intimidated and frustrated with, until I found your channel. Then it became my favorite language to work with!
@lucostz
@lucostz Ай бұрын
Super clear, thanks!
@christo4520
@christo4520 3 ай бұрын
Another amazingly explained concept man!!!
@Kuba200411
@Kuba200411 9 ай бұрын
Hi John! Could you do some videos about design patterns like Singleton, and others?
@mayurpatel481
@mayurpatel481 8 ай бұрын
It was very nicely explained. Thanks John.
@kevinkoomson7873
@kevinkoomson7873 2 ай бұрын
This is gold. Thanks John
@TerryPlays
@TerryPlays 9 ай бұрын
Great to see you back with a new video! Thanks
@Hianfita
@Hianfita 4 ай бұрын
Best explanation I've ever heard! Thanks a lot!!!!
@user-rm4oq9uh8j
@user-rm4oq9uh8j 3 ай бұрын
John, you're the man!!! I have finished a bootcamp and learned core Java in 3 months from zero. Now, after a year, going through all the topics with your videos is perfecting my knowledge and making me feel more comfortable with things that I've learned. Your efforts in sharing your knowledge are very much appreciated!
@codeZarathustra
@codeZarathustra 9 ай бұрын
Thanks very much Jhon.
@davidorevic6651
@davidorevic6651 7 ай бұрын
Thank you so much John!I was questioning myself a lot regarding this matter 💥
@Do11an
@Do11an 3 ай бұрын
Perfect video, thank you!
@muhannadFahmy
@muhannadFahmy 9 ай бұрын
It is sooo clear, thanks to you
@shaygoldin
@shaygoldin 9 ай бұрын
Hi John. thank you so much! your videos are truly the best!
@paulthomas1052
@paulthomas1052 9 ай бұрын
Very useful video as usual - cheers !
@jonathan2350
@jonathan2350 5 ай бұрын
Thanks, understood it!
@lootster
@lootster 13 күн бұрын
This 11 mins video probably saves you HOURS of research on the internet what the keyword Static means, you're the best John! 👏
@mathewajayi2482
@mathewajayi2482 6 ай бұрын
❤ Thank you for this...the concept is so much simpler.
@jerrygord3131
@jerrygord3131 15 күн бұрын
This was extremely helpful, thank you so much!
@srishtijoshi5980
@srishtijoshi5980 25 күн бұрын
Your examples are spot on. Its easy to understand the difficult concept when you explain it.
@kraxmalism
@kraxmalism 6 ай бұрын
it is no longer confusing after this video. appreciated!
@rachiimade4073
@rachiimade4073 3 ай бұрын
it was a very clear explanation ,thank for your efforts for making this get sence.
@bytecode5834
@bytecode5834 9 ай бұрын
Very helpful, many thanks!
@laali_puppy
@laali_puppy 9 ай бұрын
Great explanation, thanks a lot!
@Carll19
@Carll19 3 ай бұрын
Before your video, I felt the same, now finally ‘static’ is clear for me, thanks!
@donaldbunce2741
@donaldbunce2741 6 ай бұрын
John, this is an excellent explanation! I'm grateful.
@jayt675
@jayt675 5 ай бұрын
Extremely helpful.
@farah2521
@farah2521 8 ай бұрын
Thank you so much! This helped so much
@axmy1776
@axmy1776 9 ай бұрын
Thank you so much John!
@thiagogo1995
@thiagogo1995 5 ай бұрын
Great video! Very easy to understand. Thank you very much.
@lemagamy
@lemagamy 9 ай бұрын
great video John, your yt channel and videos are amazing!
@sandra_witch
@sandra_witch 5 ай бұрын
You're a great teacher, thank you so much!
@JuanRamirez-fx3tf
@JuanRamirez-fx3tf 9 ай бұрын
Evening John, I've been following you since I started a Java course this summer. I've finished a project using static, I use the concept, but I do no know why. I am going to enjoy this video.
@gaetanolopez7779
@gaetanolopez7779 4 ай бұрын
I utilized your content as a reference for my university assignment, citing it in APA format. Your material was incredibly helpful, simplifying complex concepts for easy comprehension. Hopefully, the university won't find any issues with my referencing!
@cisco8237
@cisco8237 9 ай бұрын
Thanks for the video really helped me
@ryyyyy2010
@ryyyyy2010 8 ай бұрын
very helpful video. tysm
@amaralensheriff
@amaralensheriff 5 ай бұрын
Awesome John, please keep on doing more such great contents.
@beetsreliable
@beetsreliable 5 ай бұрын
Very helpful!
@expekeyt2998
@expekeyt2998 9 ай бұрын
Thank you for your teaching!
@user-jc6es2ku6d
@user-jc6es2ku6d 23 күн бұрын
this is such a live saver for me, who was forced to jump from C to Java, and lost all motivation at the first days via confusion. Now with a better explained Theory and Concepts by you, @Josh, it is strarting to make sense and become understandable, and i also tend to like it more, eventhough i do bad with a little more abstract languages. thanks :)
@wasim_17
@wasim_17 9 ай бұрын
Nice explanation.
@anghamjbeli3037
@anghamjbeli3037 9 ай бұрын
great explanation
@user-qw6dy5tg8j
@user-qw6dy5tg8j 6 ай бұрын
That was very informative, thanks a lot
@felipel.r.637
@felipel.r.637 9 ай бұрын
Brilliant as always, thank yu very much
@dayshiasweet
@dayshiasweet 9 ай бұрын
Amazing explanation
@solvejtodd2960
@solvejtodd2960 Ай бұрын
THE Best explanation of this on the internet.
@Askalon08
@Askalon08 8 ай бұрын
Can you pls make a video about modules in Java? ur the best❤
@Sagittarius182
@Sagittarius182 3 ай бұрын
Very nice explanation. Thank you very much 😸👌
@zladtv1456
@zladtv1456 7 ай бұрын
Very useful!
@Leetneetcode1729
@Leetneetcode1729 9 ай бұрын
much needed thanks very cool
@minfiresmanyeah
@minfiresmanyeah 7 ай бұрын
Thank you!!
@Mirtguitar
@Mirtguitar 6 ай бұрын
Great tutorial
@Necrobin
@Necrobin 21 күн бұрын
beautiful, thanks
@fathimasalooja
@fathimasalooja Ай бұрын
awesome,Thank you.
@gabrielfono844
@gabrielfono844 5 ай бұрын
Sir I am going to lie you are absolutely amazing. I taught programming 3 years ago and I have been working professionally for almost two years. always your videos are amazing. Thanks so much.
@kokosensei5231
@kokosensei5231 6 ай бұрын
Thank you!
@andreperez5850
@andreperez5850 9 ай бұрын
Glad to see you again sir
@vogiansatnaaihonglien6780
@vogiansatnaaihonglien6780 9 ай бұрын
Thanks a lot for your video! Tbh i was stuck with the same problem of not able to access the rest controller class in Spring since non-static class and method cannot be access without instantiated, so after i watched your video i went to look back at some information and found out that you can just autowired the class object from the beginning :v You really helped me pointing out the vagueness of my understanding about all this static non-static thing, thank you!
@yashsureka9552
@yashsureka9552 3 ай бұрын
you teach so difficult concepts so easily
@julie3447
@julie3447 8 ай бұрын
I like how u make it so simple. thank u so much
@mohammadbayat1635
@mohammadbayat1635 5 ай бұрын
Wow, thanks John
@bumilib9785
@bumilib9785 9 ай бұрын
you're the best! thanks
@user-rm1cq1kx4b
@user-rm1cq1kx4b 9 ай бұрын
This is a very good video. I used to abuse the "static" keyword, and it caused so many bugs that I am only now beginning to understand 3 years into my coding. Lol
@JoseFranc
@JoseFranc 9 ай бұрын
Thank you so much
@Goooogle
@Goooogle 9 ай бұрын
You are a good teacher
@personalaccount1515
@personalaccount1515 9 ай бұрын
Hi. I really love all your videos, PLS keep doing it,. Thanks for everything,
@iknowtoomuch
@iknowtoomuch 8 ай бұрын
شكرا لك!
@davod9638
@davod9638 8 ай бұрын
Hey John, Can you make a video about Java modules? Really important, thank you. You are the best!
@johnandrewbotros8972
@johnandrewbotros8972 9 ай бұрын
your channel is very helpful i learned so much from it keep uploading
@CodingWithJohn
@CodingWithJohn 9 ай бұрын
I don't get to as often as I'd like but I'll keep it going!
@KARTIKKUMAR-vm8ht
@KARTIKKUMAR-vm8ht 8 ай бұрын
Hey jhon, i have seen most of your videos on java and they are good. I have a request Please make videos on spring and spring boot as well
@yoyomaster223
@yoyomaster223 5 ай бұрын
Relearning Java right now after close to 8 years never touching it. I remember never understanding what static meant and how it was used. Gave me so much grief trying to figure it out. Been debugging a few if statements today for close to 5 hours, come to find out it had to do with needing a static declaration. Long story short, found this video and everything finally made sense! Thank you!
@Ironman-sn4ct
@Ironman-sn4ct 7 ай бұрын
Hey Sir! I am from India and I am learning java by watching your videos ❤❤ Thank you Sir 😊😊
@bioblade87
@bioblade87 8 ай бұрын
Someone told me that Static is the same as the "Shared" keyword in VB. Calling it "Shared" instantly made sense to me as opposed to "Static". Goes without saying, great video and breakdown of the topic.
@hayetaitouazzou7290
@hayetaitouazzou7290 9 ай бұрын
Amazing !!
@Avinash-fm6we
@Avinash-fm6we 2 ай бұрын
It was a very good video for anyone to understand Static vs Non-Static Variables and Methods In Java.
@axecordgaming2003
@axecordgaming2003 7 ай бұрын
thank you !!!
@hobisnatchedmywig9001
@hobisnatchedmywig9001 5 ай бұрын
ur literally the best
@MooseAntlers-ym4de
@MooseAntlers-ym4de 2 ай бұрын
WHY ARE YOUR VIDEOS SO GOOD AND EASY TO UNDERSTAND DO YOU KNOW HOW MANY PEOPLE YOU HAVE SAVED THANK YOU SO MUCH 🙏🙏🙏🙏🙏🙏🙏
@armenuhiyeghoyan5419
@armenuhiyeghoyan5419 Ай бұрын
Your English is perfect.The best one for me to develop speaking skills.
@cvl--
@cvl-- 9 ай бұрын
I've learned by the terms "static"/"instance" when talking about methods and variables. I think it is less confusing than static or non-static, specially for beginners.
@dzeremi1625
@dzeremi1625 Ай бұрын
nice, goated explanation
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 200 М.
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 113 МЛН
Final muy increíble 😱
00:46
Juan De Dios Pantoja 2
Рет қаралды 45 МЛН
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 10 МЛН
The 3 Laws of Writing Readable Code
5:28
Kantan Coding
Рет қаралды 329 М.
Introduction to Methods in Java
21:46
Gilal Academy
Рет қаралды 128
Static Variables and Static Methods in Java
9:31
Neso Academy
Рет қаралды 117 М.
Lambda Expressions in Java - Full Simple Tutorial
13:05
Coding with John
Рет қаралды 711 М.
Array vs. ArrayList in Java Tutorial - What's The Difference?
17:36
Coding with John
Рет қаралды 500 М.
Java Reflection Explained - bɘniɒlqxƎ noiɟɔɘlʇɘЯ ɒvɒᒐ
20:07
Coding with John
Рет қаралды 173 М.
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 113 МЛН