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

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 305

  • @neon0wl2107
    @neon0wl2107 Рік тому +53

    1:52 cleared a doubt i have been having for over 5 years. Thanks a lot.

  • @stingray-q5p
    @stingray-q5p Рік тому +138

    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

  • @micleh
    @micleh Рік тому +52

    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.

  • @tshepisoseabi1069
    @tshepisoseabi1069 9 місяців тому +4

    You have no idea how long I've been struggling to understand this, thank you John.

  • @lootster
    @lootster 7 місяців тому +13

    This 11 mins video probably saves you HOURS of research on the internet what the keyword Static means, you're the best John! 👏

  • @matiloki
    @matiloki Рік тому +9

    My goodness, years using it without knowing how to explain this to other people. Now I can teach it. Thanks!!!

  • @sangjunlee8200
    @sangjunlee8200 2 місяці тому +3

    Great content. I'm a non-native but this video was very easy to follow. Nice pronunciation, big fonts, easy-to-understand examples... UA-cam needs more videos like this

  • @yoyomaster223
    @yoyomaster223 Рік тому +3

    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!

  • @yte6598
    @yte6598 Рік тому +11

    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!

  • @GabrielLima-yq6qp
    @GabrielLima-yq6qp Рік тому +26

    how did you know that i needed this video? your content is so amazing keep going

    • @CodingWithJohn
      @CodingWithJohn  Рік тому +27

      I have eyes everywhere 👀

    • @erikseyranyan5490
      @erikseyranyan5490 Рік тому

      Love you bro. You are the best teacher. Understand your videos are very easy your methods of teaching are the best@@CodingWithJohn

    • @muhammetalimutlu6748
      @muhammetalimutlu6748 Рік тому

      @@CodingWithJohn mr you are great thank you

    • @LANternFly1001
      @LANternFly1001 10 місяців тому

      @@CodingWithJohn I pray for your codiness Saint John.

  • @HasanSahin-n8d
    @HasanSahin-n8d 10 місяців тому

    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!

  • @sohamdeshpande3654
    @sohamdeshpande3654 22 дні тому +1

    Beautifully explained, clear, and concise. Thanks

  • @sgretsch
    @sgretsch Рік тому +7

    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!

  • @timmann109
    @timmann109 Рік тому +3

    Best description I have seen on this topic. Thanks

  • @a7mdbest15
    @a7mdbest15 Рік тому +134

    Anyone wants to learn java, this is the destination

    • @NotJediYet
      @NotJediYet 2 місяці тому

      Nah, C# is better😂

    • @jeffkidder5282
      @jeffkidder5282 Місяць тому +1

      Very worky and confusing when flipping and looking for an immediate example. A person must have a well established understanding of the issue beforehand.

    • @eduteme234
      @eduteme234 23 дні тому

      ❤1q❤q.

  • @kingslymatthew5586
    @kingslymatthew5586 Рік тому +16

    Your contents are easy to follow & understand. Thanks John.✌🏼

  • @sabat2906
    @sabat2906 5 днів тому

    MY GOAT! Helping me before my AP CSA test

  • @olivierbegassat851
    @olivierbegassat851 Рік тому +6

    Those explanations are crystal clear ... You are an amazing teacher, and those lessons are invaluable 😃

  • @SacharMolotov
    @SacharMolotov 7 місяців тому +1

    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 :)

    • @lazeatscrayons2426
      @lazeatscrayons2426 4 місяці тому

      lol, I've become so accustomed to using the C language that learning Java has been such a headache, glad this man exists

  • @akshitmittal1251
    @akshitmittal1251 7 місяців тому +1

    U have very POSITIVE vibe. There are v less people like u. Thanks for all tutorials

  • @TimHonisett-m1x
    @TimHonisett-m1x 4 місяці тому

    Went back to this video and it didn't disappoint! Clear and straight to the point

  • @andyhicks3472
    @andyhicks3472 Рік тому +1

    This is the clearest explanation of static I have come across. Thank you!

  • @philb4462
    @philb4462 4 місяці тому

    This is fantastic. "Static" has puzzled me for a long time. This is a very clear explanation. Thank you.

  • @gabrielfono844
    @gabrielfono844 Рік тому

    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.

  • @petrliszok9519
    @petrliszok9519 Рік тому +2

    wow... In my 33, I am trying ro change my career and learn to code and your videos are literally saving my a...! :)

  • @Kuba200411
    @Kuba200411 Рік тому +21

    Hi John! Could you do some videos about design patterns like Singleton, and others?

  • @Hassan-lv9di
    @Hassan-lv9di Рік тому

    Simplicity, straight forward, depth.. yep that's CodingWithJohn !
    I love you man! KEEP UP THE HARD WORKING

  • @jessicar5549
    @jessicar5549 Рік тому +1

    John. I just need to say I am so thankful I’ve run across your channel. Thank for educating us all!!!

  • @magadiflo-dev
    @magadiflo-dev Рік тому +2

    He really has a simple and very understandable way of explaining these concepts. Thank you very much for sharing them. Greetings from Peru

  • @gaetanolopez7779
    @gaetanolopez7779 11 місяців тому

    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!

  • @AdrianTregoning
    @AdrianTregoning Рік тому +2

    Pure gold, that made it easy to understand. Thanks John.

  • @eyupdeli7860
    @eyupdeli7860 5 місяців тому

    you literally made everyting crystal clear in my mind, thanks a lot

  • @DejiAdegbite
    @DejiAdegbite Рік тому

    Here's me shouting at you in the comments: GREAT VIDEO. I LOVE THAT YOUR VIDEOS ARE SHORT, SIMPLE AND STRAIGHT TO THE POINT. 😄

  • @Carll19
    @Carll19 10 місяців тому

    Before your video, I felt the same, now finally ‘static’ is clear for me, thanks!

  • @srishtijoshi5980
    @srishtijoshi5980 7 місяців тому

    Your examples are spot on. Its easy to understand the difficult concept when you explain it.

  • @ArmenianGenXGuy
    @ArmenianGenXGuy Рік тому +1

    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

  • @bioblade87
    @bioblade87 Рік тому

    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.

  • @Ironman-sn4ct
    @Ironman-sn4ct Рік тому +1

    Hey Sir! I am from India and I am learning java by watching your videos ❤❤ Thank you Sir 😊😊

  • @cvl--
    @cvl-- Рік тому +2

    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.

  • @JuanRamirez-fx3tf
    @JuanRamirez-fx3tf Рік тому

    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.

  • @davod9638
    @davod9638 Рік тому +4

    Hey John,
    Can you make a video about Java modules? Really important, thank you. You are the best!

  • @Shamim-oh8rw
    @Shamim-oh8rw Рік тому

    I'm from lran and I don't know English pretty much but you speak simply and I understand it keep going my friend ❤

  • @armenuhiyeghoyan5419
    @armenuhiyeghoyan5419 8 місяців тому

    Your English is perfect.The best one for me to develop speaking skills.

  • @gnair9064
    @gnair9064 Рік тому

    Hi john, i was working as a junior java developer 10 years ago. Due to the lack if child care u could nit get back to work. But now am trying to get back to work. Can you please give me aome advice so i can kick start. I watch your videos and am so grateful for all those vidoes. Please keep posting

  • @SupahBro535
    @SupahBro535 10 місяців тому +6

    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!

    • @toby9999
      @toby9999 5 місяців тому +1

      I'm in the same boat, but I'm transitioning from 30 years as a C++ developer. My brain is a little too old and stuck in the C++ mindset.

  • @MooseAntlers-ym4de
    @MooseAntlers-ym4de 9 місяців тому

    WHY ARE YOUR VIDEOS SO GOOD AND EASY TO UNDERSTAND DO YOU KNOW HOW MANY PEOPLE YOU HAVE SAVED THANK YOU SO MUCH 🙏🙏🙏🙏🙏🙏🙏

  • @الهدىهدىالله-ش7ي
    @الهدىهدىالله-ش7ي 4 місяці тому

    Clear and beautiful explanation. Thanks

  • @Avinash-fm6we
    @Avinash-fm6we 9 місяців тому

    It was a very good video for anyone to understand Static vs Non-Static Variables and Methods In Java.

  • @Aporajita_.29
    @Aporajita_.29 10 місяців тому

    I'm in 10th grade rn and this video of yours has helped me alot
    Thank you John

  • @kraxmalism
    @kraxmalism Рік тому

    it is no longer confusing after this video. appreciated!

  • @Josuke217
    @Josuke217 3 місяці тому

    You are goated , I love Java. This is truly the best place to learn it

  • @Luizanbrg
    @Luizanbrg 3 місяці тому

    This video is amazing and very easy to understand ! Thank you

  • @Ivan-kh3gn
    @Ivan-kh3gn Рік тому +1

    Hey John!
    I've got a question for you 🙃
    My java teacher told me that using the keyword break anywhere but in switch() is a bad practise. Why is that?
    It works fine in any loop and I've always used it that way.
    Could that be a subject for new video? Or perhaps an answer to this comment x)
    Love your videos! You really are great explaining :)
    Thanks!

  • @aryehabowitz2321
    @aryehabowitz2321 5 місяців тому

    amazing video very clear and articulate which is needed to understand this concept

  • @domnulpufosila434
    @domnulpufosila434 Рік тому

    You have my like, not because you explain this concept so well, cause you do. But because of the way you "miau".

  • @solvejtodd2960
    @solvejtodd2960 8 місяців тому

    THE Best explanation of this on the internet.

  • @chaitanya.g-4531
    @chaitanya.g-4531 6 місяців тому

    THANKS JHON! ur class was amazing.

  • @christo4520
    @christo4520 10 місяців тому

    Another amazingly explained concept man!!!

  • @TerryPlays
    @TerryPlays Рік тому

    Great to see you back with a new video! Thanks

  • @ahmedbilal018
    @ahmedbilal018 5 місяців тому

    best explanation so far

  • @shreyapatil5814
    @shreyapatil5814 17 годин тому

    Thankyou very much for that crystal clearance

  • @iddiramadhani5111
    @iddiramadhani5111 6 місяців тому

    This is real well understood, thanks bro.

  • @growmoreyt4192
    @growmoreyt4192 6 місяців тому

    This clears everything about static and non-static.

  • @noumansaiyed343
    @noumansaiyed343 5 місяців тому

    Amazing explanation 🎉I clear my doubt after watching this video

  • @rachiimade4073
    @rachiimade4073 10 місяців тому

    it was a very clear explanation ,thank for your efforts for making this get sence.

  • @Askalon08
    @Askalon08 Рік тому +3

    Can you pls make a video about modules in Java? ur the best❤

  • @lszujo
    @lszujo 4 місяці тому

    Java makes sense to me,it's just logical...more than Python ever did....I enjoy your tutorials.great job!Thanks!

  • @vogiansatnaaihonglien6780
    @vogiansatnaaihonglien6780 Рік тому

    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!

  • @Jyotigupta-vs4mz
    @Jyotigupta-vs4mz 2 місяці тому

    ❤😘I'm shouting out that you clear this concept to me and moreover thanks for saying it's confusing because I was frustrated before

  • @raderadovanovic9052
    @raderadovanovic9052 Рік тому +1

    Very nice explanation. Keep up with a good work John!

  • @SupahBro535
    @SupahBro535 10 місяців тому +1

    Literally better than all my comp sci profs

  • @yashsureka9552
    @yashsureka9552 10 місяців тому

    you teach so difficult concepts so easily

  • @Hianfita
    @Hianfita 11 місяців тому

    Best explanation I've ever heard! Thanks a lot!!!!

  • @BrickyBoi
    @BrickyBoi 24 дні тому

    You are such a great teacher

  • @davidorevic6651
    @davidorevic6651 Рік тому

    Thank you so much John!I was questioning myself a lot regarding this matter 💥

  • @KARTIKKUMAR-vm8ht
    @KARTIKKUMAR-vm8ht Рік тому

    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

  • @xavier4dinner
    @xavier4dinner 4 місяці тому

    After watching this video, wow just wow. You managed to explain better than my professor

  • @ozaanyigit
    @ozaanyigit Рік тому

    great video John, your yt channel and videos are amazing!

  • @darkojitsu
    @darkojitsu Рік тому

    John, this is an excellent explanation! I'm grateful.

  • @cyberkiller83
    @cyberkiller83 Рік тому

    Hi john, as always, amazing video. You miss two things thought.
    1 Miss to mention that when you create static members of a class, the system automatically make those instances one they are used the first time.
    2 MIss to mention the static code blocks static { } and how this code blocks are called the first time a static member is called, so those can be used like some kind of constructor.
    Great videos!

  • @jerrygord3131
    @jerrygord3131 7 місяців тому

    This was extremely helpful, thank you so much!

  • @kevinkoomson7873
    @kevinkoomson7873 9 місяців тому

    This is gold. Thanks John

  • @mayurpatel481
    @mayurpatel481 Рік тому

    It was very nicely explained. Thanks John.

  • @NalbertWattam
    @NalbertWattam Рік тому

    What about static/non-static methods and variables in a Spring environment, where there's @Component, @Service, @RestController, etc?
    Prime work as always!

  • @thiagogo1995
    @thiagogo1995 Рік тому

    Great video! Very easy to understand. Thank you very much.

  • @amaralensheriff
    @amaralensheriff Рік тому

    Awesome John, please keep on doing more such great contents.

  • @shahabshafiee3333
    @shahabshafiee3333 Рік тому

    Best Java channel ever.

  • @sandra_witch
    @sandra_witch Рік тому

    You're a great teacher, thank you so much!

  • @mathewajayi2482
    @mathewajayi2482 Рік тому

    ❤ Thank you for this...the concept is so much simpler.

  • @gonenikhil8189
    @gonenikhil8189 2 місяці тому

    Thank you! this video worked for me

  • @yashponam1055
    @yashponam1055 6 місяців тому +2

    Watching the whole series as a preparation for interviews

  • @helloworld4147
    @helloworld4147 Рік тому

    John- the God of coding!

  • @Meenimie
    @Meenimie 4 місяці тому

    This was helpful. Thank you.

  • @johnandrewbotros8972
    @johnandrewbotros8972 Рік тому

    your channel is very helpful i learned so much from it keep uploading

    • @CodingWithJohn
      @CodingWithJohn  Рік тому

      I don't get to as often as I'd like but I'll keep it going!

  • @shaygoldin
    @shaygoldin Рік тому

    Hi John. thank you so much! your videos are truly the best!

  • @gajananmahajan1081
    @gajananmahajan1081 11 місяців тому

    John, could you please create a video on Comparator and Comparable in Java?

  • @julie3447
    @julie3447 Рік тому

    I like how u make it so simple. thank u so much

  • @prashantbharti2650
    @prashantbharti2650 Рік тому

    Such simple and accurate concepts should be present for all blooming buds😇

  • @citral5111
    @citral5111 2 місяці тому

    Absolutely brilliant video thank you :D

  • @rudranighoshroy8412
    @rudranighoshroy8412 5 місяців тому

    I was working on Token Management and this asaved me :)