Java Constructor Tutorial - How To Use A Constructor in Java #74

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

КОМЕНТАРІ •

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

    If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h

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

      Awesome video, Alex. Thank you!
      Please what is the title of the background song in the beginning of the video?

  • @Randomlolstudios
    @Randomlolstudios 5 років тому +468

    I think I learned more about constructors in this tutorial than the last few weeks of my cs course in college, thank you for making it.

    • @Dennou85
      @Dennou85 5 років тому +6

      I have to agree, I felt exactly the same way.

    • @jeremydutton193
      @jeremydutton193 4 роки тому

      Ditto

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

      I disagree, this is completely WRONG. EVERYTHING is fucking STATIC.... this has nothing to do with objects or constructors.. the constructor in this video is completely unneccesary. He didn't mention the "this" keyword and didn't even manage to encapsulate the class. Yeah you may think you understand this. Because it's completely wrong. If you use constructors and classes like this then enjoy your F in your college cs course.

  • @suyogb7325
    @suyogb7325 4 роки тому +197

    4 java books and multiple online courses on java, yet whenever I have a java doubt I re-watch your video. Thank You.

  • @VivianHuangSnowy
    @VivianHuangSnowy 5 років тому +722

    Your way of teaching is so stress-relieving and easy to understand :') Thank you so much

    • @jonathanphillips5915
      @jonathanphillips5915 4 роки тому +2

      Big facts 🔥

    • @thaminduKavinda
      @thaminduKavinda 4 роки тому +2

      Yeah, that's true

    • @saswataroy1699
      @saswataroy1699 4 роки тому +6

      Yeah when I see his tutorials it seems like a friend is teaching to me which helps me to understand the topics in better and easy way...

    • @iliasi.4004
      @iliasi.4004 3 роки тому

      not when u put it on double-speed

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

      Bruh did you even subscribe

  • @jordanbrown2173
    @jordanbrown2173 3 роки тому +37

    Honestly might cry, I've been completely lost in this course over the past few weeks and finally am starting to understand it thanks to these videos. Thank you

  • @TheStewie96
    @TheStewie96 4 роки тому +13

    If my prof would explain it like you do, my life would be way more easy and I wouldnt waste so much time. Im so glad Ive found your channel. Love you

  • @tressaortiz2078
    @tressaortiz2078 3 роки тому +15

    I always read my notes, read the book, then I go on UA-cam and type in the subject + "Alex Lee". So thankful for the way you explain things that professors and books tend to miss the mark on

  • @AN-nk5yl
    @AN-nk5yl 4 роки тому +51

    Univeristies are missing out by not having you as a professor.

  • @cosminionut5521
    @cosminionut5521 5 років тому +113

    Hello! I recently discovered you but it seems pretty straight forward and to the point the way you teach. Hope you won't stop doing tutorials because for small students who struggle to learn extra stuff beside school is really helpfull.

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

    My instructor chose to use your videos for our class, and I see why, this was so easy to follow, thank you so much!!

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

    Constructor basically creates an object - That line took off all the confusion. Thanks Alex.

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

    your positive and encouraging way of explaining things is a relief from the monotonous and depressing type of education I receive at university. Thanks alot!

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

    Every time that I don't understand any tutorial from the web, I always go to this channel and everything seems easy to understand now. Thank you!

  • @AbhinavKumar-dr4ef
    @AbhinavKumar-dr4ef 2 роки тому +4

    You teach from the basics and how to think like a beginner. Awesome. Thank you.

  • @StreakyFly
    @StreakyFly 2 роки тому +4

    Great tutorial! In 15 minutes I learnt more than what I did in 150 minutes in university.

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

    My lecturer took 4hours to explain this but you made me understand this completely in 12mins..

  • @Aleksei_Zukovski
    @Aleksei_Zukovski 4 роки тому

    I have strated to learn Java and i have my first test on the 27th of octobre. I always watch your videos to really understand what i have to do. Thank you really much from the Netherlands!!

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

    I moved college school because of pandemic. The previous college i went was using Python and the school I'm moving to is using java. This helps me a lot to transition since I'm taking data structures now, thanks!

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

    One of the best ways to see if you understand something is to see if you can teach it to someone else, and I must say, the way you explain things so great! You have such a good way of breaking things down and showing how each piece works together! I wish i had known about your channel when I was getting my certificate for full stack java developer, it would have helped a lot!

  • @13guile
    @13guile 4 роки тому +23

    3:10 you can just type "sout" then press tab. You're welcome guys

    • @13guile
      @13guile 4 роки тому +4

      that hotkey is for NetBeans IDE, im sorry

    • @M.RR.M.888
      @M.RR.M.888 4 роки тому +2

      Thank you!! it worked with my NetBeans IDE.

    • @bubboydarker9030
      @bubboydarker9030 4 роки тому +4

      in eclipse: type "sout" then press ctrl + space

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

      eclipse : you can try "sysout" then press (ctrl+space).

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

    I like how you explained the concepts without using all the Java terms that I heard in other tutorials. Like how you said that a constructor creates objects. Or that a constructor is a method. That stuff is easy for me to comprehend.

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

    THANK YOU! This really answered a lot of questions for me.

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

    Most heroes where capes all you do is stand behind a camera and make life easier ❤️you're a hero

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

    Why aren't you doing it anymore? I really love learning programming but is often stuck or too slow that it becomes too frustrating to continue only because I lack proper guidance. But I am trying again and I'm so grateful that I got to know about your videos. It is so helpful. Thank you so much.

  • @tobbykem8241
    @tobbykem8241 2 роки тому +2

    I love the way you explain each concepts with the recap at the end. Your videos is more helpful in my study in Java programming.

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

    Brilliant, this totally made more sense than 2 chapters and 2 lectures I've taken.

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

    I love how you walk through an example of each concept and not just spit definitions at us. Appreciate you posting these videos, makes learning java and coding much easier and less stressful.

  • @CosmonautCoding
    @CosmonautCoding 4 роки тому

    I spent 3 hours reading Java notes and got nowhere. Watched this video twice and suddenly it all makes sense. Thank you!

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

    this guy is easily becoming my favorite UA-camr

  • @linuxworld3686
    @linuxworld3686 4 роки тому +2

    Man, I can't image I am learning 2 hours lectures in 10 minutes. WOW keep the good work.

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

    The way you explanation this really improved my way of viewing the constructor object.

  • @Murga_Mutton
    @Murga_Mutton 4 роки тому +1

    More than the teaching, your videos are calm and ASMR like. It soothes my nerves when I watch the video.

  • @abdeselamselami4532
    @abdeselamselami4532 4 роки тому

    Thanks a lot Alex, for everyone the short-cut of System.out.println() is type sysout + hit buttons ctrl+space.

    • @kyte2000
      @kyte2000 4 роки тому

      sout Tab is much easier for System.out.println().

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

    Literally better than my lessons in college. Bravo! Can't thank you enough!

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

    The “sysout” shortcut may have just saved my life. Thank you sir.

  • @alexkim-soo2845
    @alexkim-soo2845 2 роки тому

    to hire you as a lecturer in any institute is an absolute win

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

    I've been a musician for 30+ years and I recently decided to make a switch to something different that will still give me an opportunity to be creative but make WAY MORE money! I enrolled in a local college to study Web Development & my Java professor talks to us as if we already know this stuff. So I enrolled in a code camp (Code Academy) to help me get caught up on all the stuff he thinks we already know.. lol.. I've been looking everywhere I can to get help. Java isn't too difficult, it's just a lot to take in all at once. Anyway, I said all of that to say that I really like your teaching style. It was easy to follow along with you. Thanks a lot!

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

    You're saving my CS first year course which I dropped, I wish I found you earlier.

  • @elijahscheinz2740
    @elijahscheinz2740 4 роки тому

    Thank you! I'm failing computer science because I have no idea what to do because I can't talk to my teacher because of Corona Virus but your videos have really helped me. Appreciate it bro.

  • @generalzt2886
    @generalzt2886 5 років тому +3

    I love how you explained this I have a final tomorrow and this was really helpful. The best part is how I also use eclipse to write code so all these tips are super nice.

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

    I've been stuck on this for the past week in class! thank you so much!

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

    thank you this helped with my exam in java for 1 semester of computer science

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

    bro I tried to understand this by watching the lecture few times but watching this made me understand the logic within 6 mins

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

    Thank you for this .this helps so much simplifying words used in my texts, especially since its 100 online classes.

  • @tomino133
    @tomino133 4 роки тому

    I'm switching teams at work from Web (React + Node) to Cloud (Java) and your channel has been helping me a ton so...thanks man!

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

    I discovered Alex, a few weeks ago. Oh boy, you do know how to explain! Loved the content, definitely not the regular teacher 😀 Thanks, thanks!

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

    I can't tell you how amazing you are for this. You're probably the only reason I might pass this class.

  • @circuit10
    @circuit10 4 роки тому

    This is great. I'm not really new to programming but I'm new to OOP, and I'm trying to contribute to an open-source Minecraft-related thing. Before I was thinking "Why would you need a class thingy for a block? Just have a numeric ID" but now after watching some of these and some other OOP videos I'm thinking "Oh, becuase you don't have to the ID and position around all of the functions and you can have methods to do things with it etc."

  • @xx_leo1
    @xx_leo1 5 років тому

    ALEX YOU'RE LITERALLY A LIFE SAVER

  • @francom1683
    @francom1683 4 роки тому

    I'm from Argentina, and I got every word you said. Great teaching. My best regards for you

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

    You actually just saved my grade, love the way you teach!

  • @imunoriginal382
    @imunoriginal382 5 років тому +1

    People really need to know about you. You explained it well in the simplest way using real life objects.
    I'm also in need of learning implementation of linkedlist using classes, so if possible I'm eager to learn it more from you because my professor is using words we've never heard of :D

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

    Finally, constructor is making sense. Thanks Alex.

  • @giornogiovanna2272
    @giornogiovanna2272 4 роки тому +2

    My teacher keeps rambling about the topic that I end up losing interest and end up getting confused. I watch you teaching for 12 minutes and I understand

  • @lukemalonis8533
    @lukemalonis8533 4 роки тому +2

    You should be proud man, I watched about 30 different videos on this, and this video is what finally made me understand 😂.

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

    THANK YOU!! I was so confused because I didn't know the default constructor was invisible.

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

    Finally I understand what a constructor is? Thank you for making this video.

  • @leonardpcs08
    @leonardpcs08 4 роки тому

    Your videos are great. I'm re-learning Java now and these videos make it possible. I joined Code with Mosh's Java course -- and when I need another explanation to his topics , I turn to your videos and they compliment really well, and I suggest everyone to do the same. Thank you, Alex!

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

    This Java Tutorial is easy to understand than other tutorials in yt haha. Thank you so much!

  • @tanyabose8085
    @tanyabose8085 4 роки тому +1

    the way u explain is like explaining very twisted and complicated things into such simple things. it would be really great if u make the same kind of videos on C and C++ tutorials too.

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

    Didn't really understood my professor in college. Thank you so much

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

    thank you for breaking it down as simple as possible...subscribed

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

    omg thank you i understood that so much better than the hour long class about objects/constructors at school

  • @ramshaakhurshid6174
    @ramshaakhurshid6174 4 роки тому +1

    Your teaching technique relive our all problem
    👍Keep it up

  • @emanuelalecsa8407
    @emanuelalecsa8407 4 роки тому +5

    thanks, man! The way you explain is so smooth and down to Earth! Keep it up!

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

    Thank you! Learning Java through you now every day :)

  • @MRHashesha
    @MRHashesha 4 роки тому +1

    I was struggling with understanding Constructors until I watched this video :) , Thanks a lot for your explanation :)

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

    syso+ctrl+space also works to print out

  • @theophilus33
    @theophilus33 4 роки тому

    Incredibly helpful, college professor's explanation made no sense but this was very clear and easy to follow. Thank you!

  • @khakramsidiqi9731
    @khakramsidiqi9731 4 роки тому +2

    I love the way you teach java concepts and mix them with practical coding, it is more fun! keep up great work, bro!

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

    Now this is a good tutorial. Large text and black on white color. Great....

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

    Thank you for your videos. I'm still learning Java, and these videos have been much food for thought!

  • @saistharanjan9217
    @saistharanjan9217 4 роки тому +2

    I literally have an exam in 45 minutes. Thanks a lot for this video!

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

    I just want to say thank you for making easy to follow content I learned more from watching your videos than I have all semester from a paid instructor!

  • @marvhartigan3677
    @marvhartigan3677 4 роки тому

    Thanks a lot buddy!Sometimes you guys don't even know how helpful you have been to others.

  • @mantub1901
    @mantub1901 4 роки тому +2

    Your simplicity in teaching, amazing man!! Concept grips with the examples make more interesting and understand in-depth, and a person learning won't forget!

  • @ilejovcevski79
    @ilejovcevski79 4 роки тому +20

    P.S. For anyone still experimenting with constructors, once you make your own custom constructor that takes parameters, but you still want to use the default constructor for the same class for some reason, you MUST make the default (empty constructor) as well. Otherwise it will no longer be available, and you' ll always have to enter custom parameters when you create objects of that class.

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

      Equal Alex made on the video, got it. Thanks for calling attention for this.

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

      @@wesldf my pleasure mate!

  • @maaan8494
    @maaan8494 4 роки тому

    tbh I just came from a 1 hour 45 min lecture on this topic and I understood your explanation better in 12 mins

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

    I love to study from you....your way of teaching is really osm..........respect from INDIA

  • @Filip-_-._.
    @Filip-_-._. Рік тому

    As a default constructor you can set values to your characteristics and not just leave it empty. It's good if you want to avoid some bugs when calling methods on an object that has no values.

  • @oyskateboard5355
    @oyskateboard5355 4 роки тому +1

    Omg bro, I love you and your amazing analogy and voice. I love how you explain and explore everything simplistically. You just saved me from a semester of failure!

  • @YouSoRusso
    @YouSoRusso 5 років тому +12

    This was awesome dude. Thanks 👍 Semaphores, Concurrency, Multithreading would be some useful lessons but whatever you do I'll be a new student for some revision. Keep it up bro. Love the peaceful vibe.

  • @MrAnloco
    @MrAnloco 4 роки тому

    "sout" followed by ctrl+space also does the trick (to printl) and is sightly shorter ;) Thx for the videos, they've been very helpfull...

  • @Josip9888
    @Josip9888 5 років тому +2

    Thank you Alex for all this tutorials you share. They are very helpfull and intertaining.

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

    This video is too good for this world🥺

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

    I really feel like (who the fuck disliked this video?). Man, I'm from Brazil, and I've got something to tell u. I've never seen someone like you, teaching Java with so many facility. Everything u say I can get and do by myself in my studies. Thanks a lot for sharing this with us, besides u stopped doing it.

  • @peterrock5560
    @peterrock5560 4 роки тому

    i'm new to java and tbh you help me soooo much with your videos!
    Thank you man , hope you're good and everything is going great!

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

    you made java a piece of cake ... thank you so much

  • @muhammadfaheem4024
    @muhammadfaheem4024 4 роки тому

    Dude!!!! You are great..... I am from Pakistan and i simply love your way of teaching.

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

    thank you alex i'm currently required to do solo learn for learning java and it's realy confusing at times you help alot

  • @TheChaosRainbow
    @TheChaosRainbow 4 роки тому

    This has been the simplest and most thorough lesson I have ever come across. Thank you for sharing and being amazing :')

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

    Thank you Sir- you are awesome. I have been fighting to understand this for almost a month

  • @smileymyronnftonlyoninstag8213
    @smileymyronnftonlyoninstag8213 4 роки тому

    You teach so well, I visited your website to enroll for your full class, but I turned away because I couldn't afford it. Although, I do believe that price will be worth it for those who can afford.

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

    Eye-opening!!!!! Thank you so much!!! Your explanation on constructors, passing parameters and giving it a reason behind it just makes your way of teaching, best!

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

    I'v just foud you ytb channel and saw most of your videos.Thank you for all that.Your teching technique is just an amazing.

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

    very easy to understand thank you i was looking for the answer as to why we need it

  • @therevjacksonplant
    @therevjacksonplant 4 роки тому +4

    I should starting watching you 8 weeks ago at the start of my class. The books I'm reading just don't do it for me. Alex Lee is great.

  • @nithin1061
    @nithin1061 4 роки тому +1

    Alex , your way of teaching is simply awesome and easy to understand. Love from india..

  • @JazminMortimer
    @JazminMortimer 4 роки тому +4

    So grateful that you exist. My university textbook is terrible T_T

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

      You’re lucky you get a text book. We learn solely from lectures...

  • @sweepingtime
    @sweepingtime 4 роки тому

    Thanks for these lessons. I've only just started my journey into Java and I'm hoping to use it to study programming for my career.