Java Constructors - Full Tutorial

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 411

  • @tumarkussainov3115
    @tumarkussainov3115 3 роки тому +315

    Beautiful tutorial! Finally, after years of coding at college, I understood in detail what Constructors are for. Even my professor wasn't able to explain the purpose of constructors is and when to use them. Just confused me even more. Thanks, you made my life easier!

    • @moonside24
      @moonside24 2 роки тому +13

      I'm glad it wasn't just me. Everything I've been learning in class made sense until constructors. Was suddenly so confused and my professor just could not explain it in a way that made sense to me. This was such a great video.

    • @tibettenballs4962
      @tibettenballs4962 2 роки тому +1

      its not spelt 'tutorial', its 'totorial'

    • @Drunrealer
      @Drunrealer 2 роки тому +1

      Drink from his bottle

    • @NicolastheThird-h6m
      @NicolastheThird-h6m Рік тому +3

      For real, why are MOST professors bad at what they do !?

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

      @@NicolastheThird-h6m Cuz those that can't do it, teach it.

  • @shadowyogi3921
    @shadowyogi3921 2 роки тому +20

    I understood and learned more about constructors than I did spending two hours reading my college textbook. You will have my forever thankfulness and gratitude. Thank you a million times over

  • @MuhammadFarooq-iw5fu
    @MuhammadFarooq-iw5fu 3 роки тому +9

    PERFECT. I have searched a lot of websites and videos but none offered the explanation and detail as you did.

  • @syedminhal7404
    @syedminhal7404 2 роки тому +95

    I've been doing Android development for almost 2 years. But never knew that I could make a constructor private. Learning many basics that I didn't knew very easily from your videos. I must say your videos are not only for beginners but also for experienced developers out there. Stay blessed!

    • @Gentleman_codes_69
      @Gentleman_codes_69 2 роки тому

      LOL BSDK 2 SAAL SA KIA JHAG MR RHA THA BC PRIVATE CONSTRUCTOR BNANA NI ATA OR KHUD KO DEVELOPER KEHTA BC TERA JAISA LOG HUTA HA JO BIO MA LIKHTA HA MINAL OFFICIAL OR MRKE KOI 15 FOLLOWERS HUTA HA LORU TATI DEVELOPER

  • @Angron004
    @Angron004 Рік тому +58

    I’m in cs 1 and am struggling a lot. I was originally an art student so switching to Cs is really hard. Your channel is a big help, thank you

  • @Achraf_0101
    @Achraf_0101 9 місяців тому +2

    life saver , i have been learning java for the past two weeks and it was super confusing language specially the syntax it was weird for me that every thing has to be inside a class , however your tutorials were a real change

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

    It's heartwarming that it so often seems the very best teachers also have the most generously priced courses.

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

    Thank you. Revesting this video after a month of bumbling around with constructors. This had everything already. Thanks so much John.

  • @LTZMSYAL
    @LTZMSYAL 2 роки тому

    The trick for the Constants class.. John you need an award bro

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

    Thank you. You explained it better in 6 minutes than two emails to my instructor after sitting through a 2 hour lecture.

  • @ahmedmukhtar6961
    @ahmedmukhtar6961 2 роки тому

    After watching 3 different youtube videos on java constructors i was still making syntax errors. He broke it down so easily that i was able to comprehend and apply the knowledge correctly without any errors.

  • @TACJOCZERO
    @TACJOCZERO 9 місяців тому +1

    Slowly but surely it’s getting better

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

    I've been programming for years, but constructors kind of flew over my head. I couldn't figure out how to access the class attributes, but this video made so much sense. Thanks so much!

  • @karim8443
    @karim8443 8 місяців тому +1

    You really have the best tutorials. I've learned more with you than in an entire semester. Thank you for real

  • @findlestick
    @findlestick 3 роки тому +8

    Great, I was actually thinking about this today. That when I instantiated an object, I had a constructor when I hadn’t even created one in its class. I was confounded. But now I have an answer, thank you. Also, your slower speech in this video helped in understanding things even more clearer than normal. Sometimes it takes the brain a few extra seconds for the terminology to click when you’re just learning all the jargon. 😊

  • @JillZimmermann-q8g
    @JillZimmermann-q8g 11 місяців тому

    Your tutorial is a million times easier to understand than the textbook we get at university. Thanks to your channel, I am able to understand Java a lot better and start coding myself, thank you!

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

    For the past 2 years am looking for the best tutor, i have never commented at all. But today Mr John u have made me understand Constructors in jst 7 minutes and I didn’t have to watch the video again. Thanks man

  • @Matt-ke4bp
    @Matt-ke4bp 2 місяці тому

    It might be a 2 year old video, but I love this series! Helping immensely with my master course

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

    I am self-study binary search trees to prepare my computer science final. This point literally confused me again so I watched your tutorial.This is such an amazing tutorial! I am really grateful for your kindess! And your tutorials are definitely much more helpful than my professor's classes. Thanks!

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

    Spent 4 years getting my CompSci and never was it this simple. It always felt convoluted whenever I tried to write a class and constructor and I would get confused. Don't know why the switch has just been flipped but man was this simple and easy to understand! Your info is great!

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

    Wow I just realised constructors are not complicated at all. Thanks to this man.

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

    YOU AMAZE ME BY YOUR LEVEL OF SIMPLICITY. AM JUST WATCHING YOUR VIDEO AND AM SMILING. WHAT IT TAKES MY PROFESSOR HOURS TO TEACH ME AND NOT STILL UNDERSTAND IT, EVEN CAUSING ME HEADACHE, YOU MAKE IT SO CLEAR IN MINUTES. SOMETIMES AM TEMPTED TO STAY AT HOME AND WATCH UA-cam INSTEAD OF GOING TO CLASS. BUT OBVIOUSLY, I CAN'T STAY HOME LOL. THANKS BRO

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

    Thanks John, Very clear! indeed! that was a smart way to put name=name to show the "this" use.

  • @pacemconcord4570
    @pacemconcord4570 2 роки тому

    This vid explained better in 7 min what my proff couldn't in 6 weeks. I thank you sir.

  • @alexandregb566
    @alexandregb566 2 дні тому

    So, Saytama got bored from fighting easy enemies who died in one punch and he is fighting JAVA now. You are a legend!

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

    the most underrated Channel of all time john, don't ever STOP!

  • @chloeliu6642
    @chloeliu6642 2 роки тому

    I wish I found you 2 years ago when I had so much passion to learn Java. Thank you so much for making this tutorial for free!!

  • @Moch117
    @Moch117 3 роки тому +34

    As a beginner Java programmer, your videos are so helpful and easy to understand. Really helped me grasp a lot of Java concepts that I otherwise find even more confused from after watching other Java tutorials
    Super underrated channel

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

    Thank you so much for your videos. I taking my first java course in university and our lecturer might be a brillant post-graduate student but he's a poor vulgarizator. You video are so concise and simple, they help me so much to digest and understand the concepts shown in my class. I'm currently studying for my midterms and your videos are straight to the point.

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

    Thank you so much! I've looked everywhere for a quality constructors explanation and yours is by far the best.

  • @pacemconcord4570
    @pacemconcord4570 2 роки тому

    The best way to teach coding, is to code using arguments and show what the result is. You totally nailed it.

  • @eyewas9245
    @eyewas9245 2 роки тому +6

    I've been learning programming for about 3 years now and I must say, John has been the most clear and helpful teacher I've found on youtube so far. I greatly appreciate you brother! Thank you so much!!

    • @38Tugay
      @38Tugay Рік тому

      lol i learn for 1 week and I am at constructors already

    • @NicolastheThird-h6m
      @NicolastheThird-h6m Рік тому +3

      ​@@38Tugay Good for you, But Difference is he can actually code. Cut down your arrogance, knowledge will never go over experience

    • @38Tugay
      @38Tugay Рік тому +4

      ​@@NicolastheThird-h6m I must concede. That comment 2 weeks ago was unnecessary and probably had no other purpose than making me feel good about my own effort. Thank you for reminding me of my rude behaviour

  • @AYOMIDECORNELIUSOGUNDELE
    @AYOMIDECORNELIUSOGUNDELE 6 місяців тому +1

    Thanks a lot man am able to do my school project

  • @Nykster
    @Nykster 2 роки тому

    you perfectly explained the "this" keyword and deserve a follow!

  • @Tuxon24rus
    @Tuxon24rus 3 роки тому +1

    I never had such clear and useful explanations ever since I started learning Java!

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

    Very well explained! I have a Java exam in 3 days, and this really helped me understand the reasoning behind constructors!

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

    thank you never really understood constructors until now

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

    John, you have sincerely helped me learn this stuff so much that I am eternally grateful. Thank you, you saint!

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

    Bro the whole 7 minutes was more informative than 2 lab classes my professor spent on explaining constructors.

  • @francksgenlecroyant
    @francksgenlecroyant 2 роки тому +13

    John is a gift to the world. Always learning new concepts from this channel

  • @mrgenetics4063
    @mrgenetics4063 2 роки тому

    paying thousands of dollars for university courses to be poorly taught from a careless and lifeless teacher and here this man taught a concept i clearly grasped in 7 minutes ......god bless the american education system.

  • @Eva-kt3tu
    @Eva-kt3tu 11 місяців тому

    7 minutes' tutorial saved me from the professor's 4 hour course, thank you

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

    wow i literally understood this after one video, when i felt so lost after class... thank you!!!!

  • @danieljames500
    @danieljames500 2 роки тому

    that was amazingly simple, didn't understand what exactly constructors did in my C++ university assignments, now with Java i need to use them and this video was perfect!

    • @CodingWithJohn
      @CodingWithJohn  2 роки тому

      They're not so bad once you understand them a little!

  • @kerwinso
    @kerwinso 3 роки тому

    You have blown all other Java teachers I've encountered online out of the proverbial water. The Seinfeld references are a nice bonus. Subscribed!

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

    You're amazing at explaining concepts. Much better than other CS tutorial youtubers that I watched to understand constructors

  •  Рік тому

    Since the college, I had doubts about constructor!! Your video helped a lot! I also have been seeing multiple projects that have the class Constants, and never thought about the private constructor, now I was able to understand that!! Thanks a lot for the video and cheers from Brazil!!

  • @adrianlowery4764
    @adrianlowery4764 2 роки тому

    John, you deserve the world, my dude

  • @user-sf9gs2pg1b
    @user-sf9gs2pg1b 9 місяців тому

    This was super helpful, thank you. I was getting confused in my class.

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

    Your explanations are excellent, I've watched two different professors give lectures on this same subject, with a bit more mixed in, but your 8-minute video was more effective for me.

  • @MaryamMaqdisi
    @MaryamMaqdisi 3 роки тому

    The private constructor thing is genius, thanks for this

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

    Just found your channel and have learned so much in 30 minutes of videos. Thank you so much for the free educational content. Not all heroes wear capes.

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

    From one John to another, thank you my brother in coding. This is all very new to me and your clear teaching is definitely helping me understand this core concepts!

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

    Thanks for such a best and clear video you are posting for free.

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

    3 Minutes in and I already understood! Thank you for making the world of coding a better place :)

  • @SuperDarkknight888
    @SuperDarkknight888 2 роки тому

    Some of this still confuses me but i followed most of it , thank you !

  • @Coccoutube
    @Coccoutube 2 роки тому +1

    Excellent John! Not only I consolidated what I already knew, but you also taught me how to prevent anybody from adding constants in my Constants class 🙂

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

    Java has been tough to pick up, these constructors are no exception. Your videos really help me out. The hard part so far has been finding good projects to experiment with because although videos like these make it click it's hard to make it stick.

  • @nadabaydoun6701
    @nadabaydoun6701 2 роки тому

    making a constructor private is so useful and new to me, thanks a lot for the amazing content!

  • @zehrairkicatal2156
    @zehrairkicatal2156 3 роки тому

    Constructors Perfectly Are Explained.Many Thanks

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

    Helped me understand classes and constructors in Dart. Thank you, a whole lot!

  • @TWVVermin
    @TWVVermin 2 роки тому

    I just learned about this today and I didnt fully understand some stuff, but with your help in this video I could fill those spots that were blank, thank you.

  • @unicaraanimations6935
    @unicaraanimations6935 3 роки тому +4

    How do you not have more views? Constructors have given me such a hard time and yet your video was the solution! Thank you very much!

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

    amazing stuff! two hours of classes in just 7 mins

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

    Tysm was kinda puzzled why my code wasn’t working but I totally understand constructors now

  • @LindseyGibson-dc6ju
    @LindseyGibson-dc6ju Рік тому

    I am taking a Java course right now, and the book doesn't come close to explaining constructors as well as you did. Thanks!

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

    This helps so much. It’s literally the best explanation I’ve seen and made so much stuff make sense

  • @clairenovak7779
    @clairenovak7779 2 роки тому +1

    So helpful and really approachable in demonstration.

  • @ThaneCap
    @ThaneCap 2 роки тому +1

    I came here to understand constructors better, which I now have a much better understanding of, but John also cleared up several important concepts that were peripheral to constructors for me. Very nicely done and the logic progression made it very clear to follow. *subscribed* thank you!

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

    glad I watched till the end and learned about a case about private constructor :)

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

    Great tutorial! very well paced and written. I don't even use java and was able to clearly understand what a constructor is and what it's used for.
    thanks! subbed

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

    This literally just saved me. Thank you!!!

  • @michaelharrington5860
    @michaelharrington5860 2 роки тому

    You have a talent for teaching. Your content is helping me through my Java coding bootcamp

  • @HR-pz7ts
    @HR-pz7ts Рік тому

    I understand but few things were left unclear but it's only a 7 min long video. Thank you.

  • @k-universe0022
    @k-universe0022 7 місяців тому

    best explanation ✨ ✨ i wish there was a whole long playlist by john bcz he is a really great teacher

  • @findlestick
    @findlestick 3 роки тому +2

    A video with all the different types of casting would be useful. Especially for objects.

  • @anikakoob2633
    @anikakoob2633 Місяць тому

    All of your videos are so helpful, thank you!

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

    Thanks, after years I finally understood them! :D

  • @imluctor5997
    @imluctor5997 2 роки тому

    i needed this video so much before starting with my project, it gives me so much logic to use. Thank you man

  • @conangoinham
    @conangoinham 2 роки тому

    you're a ninja. Very succinct description that helped clear this one up. Plenty of info out there about how to write constructors... yours was the first one that made it clear WHEN to use them. So crucial.

  • @jasonwood5024
    @jasonwood5024 2 роки тому

    Thank you! These tutorials are helping greatly with my first college java course.

  • @saveUyghurs
    @saveUyghurs 27 днів тому

    I wish I had this video back when I was in school

  • @Garrison86
    @Garrison86 3 роки тому +1

    Thank you very much for this content, you explain it as clear as possible! I've watched other videos and they skip past parts, not explaining any of the syntax, much appreciated

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

    Thank you a lot! I have been struggeling with how to use a consttuctor and what it even is used for. Your 7min video made that absolutely clear. I liked en subscribed! :) :)

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

    im in my second year of compsci and i STILL come back to this video

  • @andreassumerauer5028
    @andreassumerauer5028 2 роки тому

    Making the constructor private to inhibit instantiation is sooo C++. 😉
    In java I would just make Constants an interface instead of a class.
    These can't be instantiated anyway so you've got no hassle with constructors plus you can even make your class implement the Constants interface and have all the static constants as members inside your class (as long as you manage to avoid naming conflicts).
    Apart from that keep up the good work. Each and every of your tutorials is just fun to watch and informative. Thanks!
    BTW: I have not found a tutorial on Java Interfaces within your videos. There is a lot that can live inside an interface apart from function prototypes.That might be a good topic for an upcoming lesson.

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

    Hey John, your videos are really helping me to clear my doubts on JAVA concepts. Thanks for sharing.

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

      I'm glad they're helping, thanks for watching!

  • @intuitiveclass6401
    @intuitiveclass6401 2 роки тому

    thank you, sometimes these concepts seem harder than they truly are

    • @CodingWithJohn
      @CodingWithJohn  2 роки тому

      Yep usually just the unknown is a little intimidating

  • @shreyadas-lx2qd
    @shreyadas-lx2qd 12 днів тому

    its an amazing short explanation ...it made me easy to learn😄

  • @flyingwaterbear5707
    @flyingwaterbear5707 2 роки тому

    Thank you so much for this video! It helped me understand constructors a lot better than my java class

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

    Bro spoke so clearly, I could still fully understand at 2x speed

  • @yadnyeshdesai6652
    @yadnyeshdesai6652 2 роки тому

    Basics of Java, man you are awesome, thanks

  • @ilikniram1
    @ilikniram1 2 роки тому

    Brilliant. Always my first stop for concept elucidation. Thumbs up mate!

  • @TechAdventurer
    @TechAdventurer 2 роки тому

    Thanks for making this videos John, I'm an Associate S.E and I have to learn Java for a new role. Coming from a Javascript background Java has been a little confusing. However, your videos have been amazingly helpful for learning the "ins n' outs" of Java. Please continue to make these videos!

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

    Hello John
    Your explanations are amazing. You go straight to the point. I must repeat the video or set the playback speed to slower to be able to get all the info ypu are providing.
    All the best!

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

    Thank you so much!

  • @abdelmoneimdwedar2157
    @abdelmoneimdwedar2157 2 роки тому

    only you and bro code are up to the task, much much love man 💪💪

  • @greengirl4985
    @greengirl4985 2 роки тому

    Thank you!!!! this was confusing me...not anymore!!!!

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

    Clear and concise explanation - thank you!

  • @thinkingimplementing
    @thinkingimplementing 2 роки тому

    this dude got super powers no tutorial can teach better than him create spring and leet code tutorials I will pay what ever you want