Java Inheritance - Subclass and Superclass Program #88

  Рет қаралды 151,459

Alex Lee

Alex Lee

Күн бұрын

Пікірлер: 187
@alexlorenlee
@alexlorenlee 11 ай бұрын
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
@tannerbarcelos6880
@tannerbarcelos6880 4 жыл бұрын
Starting with c++ and then going to java really makes you a better programmer. After learning some key things about java, I understand all this so much now. Java is godly for OOP
@WisomofHal
@WisomofHal 4 жыл бұрын
yass++;
@bensalemmohamedabderrahman5844
@bensalemmohamedabderrahman5844 4 жыл бұрын
oop in c++ is scary to me .
@samuelmolcan1442
@samuelmolcan1442 4 жыл бұрын
Hi Alex, Could you please make a video about some large Java project? Some project from real life, for example some project from your job, to see how classes and packages work together, which methods are most used and things like that. Thank you very much, I love your videos
@Justit7843
@Justit7843 4 жыл бұрын
yeah id love that toooo
@tabrezshaikh7705
@tabrezshaikh7705 4 жыл бұрын
I'd love to see that too
@kakoliparial4410
@kakoliparial4410 4 жыл бұрын
Yes I would be also intertested to see one.
@bad_robot
@bad_robot 4 жыл бұрын
YES! It's one thing to learn all of these concepts individually, but seeing how they all work together would help so much.
@saennia
@saennia 4 жыл бұрын
Same, a lot of the examples we use and see in learning is just how to print stuff in the methods or use math equations. We never see the user input of real life scenarios. We just see us presetting attributes inside the program. PLEASE
@Ben-zq7tb
@Ben-zq7tb 2 жыл бұрын
Hey Alex! I was watching another Java tutorial and stumbled across this video. I recognize you from high school! I'm currently working on my computer science degree and UNC and should be done next year. Congrats on all your success. It's really cool to see someone from Durham doing well. Keep it up, man!
@konam4341
@konam4341 4 жыл бұрын
Bro thank you so much for your tutorials we are learning a lot. Dont stop bro.
@alexlorenlee
@alexlorenlee 4 жыл бұрын
no problem, thank you for watching :)
@ashur026
@ashur026 2 жыл бұрын
he stopped lol
@ashleygarcia756
@ashleygarcia756 Жыл бұрын
You don't know how much I needed this clarification/exercise, thank you so much in the name of all the new java programmers😄
@kiffar
@kiffar 4 жыл бұрын
Bro this one video just summed up the last 4 lectures of my Principles of Java class. You are amazing.
@leanye2808
@leanye2808 3 жыл бұрын
Lifesaver, my lecturer cannot explain this topic of Java in 2 hours, but you managed to do it in less than 15 minutes!
@altain574
@altain574 3 жыл бұрын
"Mom, can we get ice cream. I've been good." This poor man's childhood 😢
@kiarastreet6180
@kiarastreet6180 2 жыл бұрын
I wish you would make more videos like this! I really need you LOLOL! This is video in particular is very helpful because youre going through real classwork.
@cybilfatima442
@cybilfatima442 11 ай бұрын
I would love it if you make videos like these more showing how to program using assignments
@deltanetrunner4146
@deltanetrunner4146 4 жыл бұрын
great work as always Alex!
@Xerxes17
@Xerxes17 3 жыл бұрын
I'm about to start a course on C++, which recommends we brush up on some Java topics like this one before we start and I found this video very helpful. It's high quality, succinct and clear. Keep up the good work on your videos!
@mr__matrix
@mr__matrix 3 жыл бұрын
1st year student here, very useful video! Thank you!!
@EkimElectro
@EkimElectro 4 жыл бұрын
Cheers. Very helpful., will go over this a few times. Thanks.
@admoonhermiz1
@admoonhermiz1 Жыл бұрын
I would love to see more assignments like these
@pallavireddy-c8g
@pallavireddy-c8g Жыл бұрын
I hate coding but the way u explain and giving the real time assignment example makes me feel to breath got a hope that i can also learn java. please upload on advance java like spring,hibernate and all. put more videos with real time scenarios it will be helpful many more like me.
@illusionistpro
@illusionistpro 4 жыл бұрын
Your videos are awesome! You're helping me get through my intro java class!
@joshuagates3108
@joshuagates3108 4 жыл бұрын
Thank You so very much Alex for taking the time to make these videos. You have helped me tremendously thus far in my journey.
@youneschoukri1184
@youneschoukri1184 3 жыл бұрын
Thanks for making this video, I'm learning this topic this week. Grateful and blessed for it. Keep your videos coming!
@YahiaHegazy
@YahiaHegazy 4 жыл бұрын
Hey Alex - Your explanations are simple and straightforward. Keep up the good work!
@Antal46
@Antal46 Жыл бұрын
Bro you saved me. I left my assignment for the last day and sitting on a stupid bug for hours because blueJ expecting a variable name instead of random string so I just skipped it and the rest of the stuff works! Thanks! EDIT: JEEEEEEEEZ IT DIDNT WORKED BECAUSE I ASSUMED BLUEJ DOES NOT NEED " " WHEN ASKING FOR STRING INPUT!!! Probably wont forget this ever in my life again.
@camiloespinazo
@camiloespinazo Жыл бұрын
Really good video, its so clear to understand
@mikebonnrieabayon781
@mikebonnrieabayon781 4 жыл бұрын
It's so Epic I learned a lot from you Thank you😊
@MANASECOSMAS
@MANASECOSMAS 5 ай бұрын
You really makes my course very simple 🎉🎉
@michaeltheisen
@michaeltheisen 2 жыл бұрын
This absolutely helped me understand it so much better thank you!
@Paersik
@Paersik 4 жыл бұрын
Very nice! I learned more from this video than from 6h lesson in my college.
@ridamuzayyan8924
@ridamuzayyan8924 3 жыл бұрын
Yes.... Just never stop making videos like this one.. Great work👍😍👌
@nirajlamichhane1678
@nirajlamichhane1678 2 жыл бұрын
i really like your way of teaching alex ! thank you from nepal
@youssef3994
@youssef3994 3 жыл бұрын
Thanks a lot, your videos are super helpful (pun inteded haha)
@jonashd6346
@jonashd6346 2 жыл бұрын
I hope i get a similar example on my test tomorrow :D
@kamprivate8133
@kamprivate8133 2 жыл бұрын
Awesome example
@LUCIFER-rc7xo
@LUCIFER-rc7xo 2 жыл бұрын
Very helpful. Thank you so much for enlightening us senpaii
@uncletan888
@uncletan888 3 жыл бұрын
Truck is a subclass of Vehicle, and neither of them is abstract. Which of the following is (an invalid) declaration and initialization? 1) Truck t = new Truck(); 2) Truck t = new Vehicle(); 3) Vehicle v = new Vehicle(); 4) Vehicle v = new Truck(); 5) All of the above are valid.
@beyond_akshii
@beyond_akshii 2 жыл бұрын
did anyone do the 5 ,6,7 part of the question...i need help storing the objects in arrays
@greenkernel2001
@greenkernel2001 2 жыл бұрын
Dude is like a Saint 🙏
@kanishkasharma2285
@kanishkasharma2285 3 жыл бұрын
You gave a great explanation.👍👍
@unnamed2369
@unnamed2369 3 жыл бұрын
alex bro i literally love you, you are saving my grade ngl
@mr.p215
@mr.p215 4 жыл бұрын
Good video, only wish you posted the link to the assignment, would have been fun to finish it.
@Relge2010
@Relge2010 Жыл бұрын
This was very helpful! Thanks a bunch!!
@Seth_Sun
@Seth_Sun 3 жыл бұрын
I could learn more from this kind of video.
@LanceLiebenberg
@LanceLiebenberg Жыл бұрын
Thanks so much bro. Changing my life😅 Honestly helps so much.
@billreed1606
@billreed1606 2 жыл бұрын
You rock and you do testing!
@Luckyme8556
@Luckyme8556 4 жыл бұрын
Hey, bro which part of the world are you from ?. This content is so amazing I just subscribed...Keep making sense
@xdestyn
@xdestyn 4 жыл бұрын
Go over nested classes please !
@courage2002
@courage2002 2 жыл бұрын
This was a great video, really appreciate it.
@KoalaTeaGuy
@KoalaTeaGuy 3 жыл бұрын
Very helpful thank you!
@George-et8sx
@George-et8sx 2 жыл бұрын
Is there a place with such similar tasks to make? I'd like to do more Thank you!
@quangnguyenduy7908
@quangnguyenduy7908 3 жыл бұрын
It is very useful. Thank you Alex!
@RandomGuy01947
@RandomGuy01947 3 жыл бұрын
This was helpful. Create more videos like this.
@josephwong2832
@josephwong2832 4 жыл бұрын
Thanks
@wasydaisy
@wasydaisy 4 жыл бұрын
Love your videos, they are so helpful! Do you think you can make a video going into detail on substring and char? Thanks!
@rittenbrake1613
@rittenbrake1613 4 жыл бұрын
very useful Thank you Alex
@shanroviquemirunillo3400
@shanroviquemirunillo3400 3 жыл бұрын
Thanks! You deserve 3 cups of coffee for that!☕☕☕
@366daysofmylife
@366daysofmylife 3 жыл бұрын
class add { public static void main ( String ar[ ] ) { int x = 10 ; int y=20 ; int z=x+y; System.out.println ( "The sum is" +z ); } } Can anyone tell me what is wrong in this because I'm getting an error.
@ericamuhammad5082
@ericamuhammad5082 2 жыл бұрын
Thank you!
@NavinPemarathne
@NavinPemarathne 4 жыл бұрын
Thank you Alex.
@wtfisggon7251
@wtfisggon7251 Жыл бұрын
I wish my teachers were that clear when telling me what I should do. I'm not bitter you're bitter.
@modelworkzseo
@modelworkzseo 4 жыл бұрын
Very clear explanation, thanks!
@behzodmamadiev2089
@behzodmamadiev2089 2 жыл бұрын
I like the sound of your typing. :)
@devoiddude
@devoiddude 4 жыл бұрын
Any chance you could do the final part of the exercise with the loop and array? please and thank you.
@khanyamarcelo1519
@khanyamarcelo1519 3 жыл бұрын
This session was so helpful to me!!!!
@daddyappa8366
@daddyappa8366 8 ай бұрын
thx, really helped
@MO-dd3cs
@MO-dd3cs 4 жыл бұрын
Hi, I want to ask you if I finish Java. I have the ability to create a program that will advise us on which languages ​​to learn
@jayeshdesai8997
@jayeshdesai8997 4 жыл бұрын
First of All Buddy, your videos are very helpful and you are doing an amazing job. Can You tell me how can I use Shoe, Walking and Running all in the same sentence? I tried doing it but it gives me an error.
@luther9828
@luther9828 2 жыл бұрын
where can i found more tasks like that
@mike20451
@mike20451 4 жыл бұрын
Thanks, Alex
@ricogidoc6979
@ricogidoc6979 3 жыл бұрын
Thanks a lot I learn more....
@zxnnightstalker2289
@zxnnightstalker2289 3 жыл бұрын
*Perfect*
@GalliadII
@GalliadII 3 жыл бұрын
why do you not use auto complete?
@vincento9456
@vincento9456 4 жыл бұрын
PolyMorphism pleaseeeee
@SandeepKaur-hm1nd
@SandeepKaur-hm1nd 3 жыл бұрын
hii alex how are you it was nice video .thankuu so much can you please make one project for me as it would be simple for you but not for me. It is a college management system project in java and i found lot of difficulities making this as i am new java learner. You can define a superclass called Person to store common properties such as name and address, and subclasses Student and Teacher for their specific properties. Define 3 classes - Person, Student and Teacher. The Person holds information about: -> the name, the age and the email. In the Student class, we need to store information about: -> the name, age, school, courses, grades and email. Name, course, grades and school are the obligatory fields. In the Teacher class we need to store information about: -> the name, school, courses, and email. Name, courses, and school are the obligatory fields. Your task is: 1. Create a UML Class diagram to represent the module. 2. To print the name, age, class, school and email of 4 students: If the email is not provided, print “no email provided”. If the age is not defined, make it equal to -1. In the console, you need to have: Student {Name: Amandeep; Email: no email provided; Age: 26; course: REQ-01; grade: 75; school: 'Matrix'} Student {Name: Lovepreet; Email: no email provided; Age: -1; course: MAT-4; grade: 65; school: 'Matrix'} Student {Name: Navjot; Email: navjot@gmail.com; Age: 21; course: PR-9; grade: 80; school: 'Gaspesie'} Student {Name: Sandhu; Email: sandhu@gmail.com; Age: -1; course: GX-10; grade: 95; school: 'Lasalle'} 3. To print the name, school and courses of 4 teachers. If the email is not provided, print “no email provided”. In the console, you need to have: Teacher {Name: Marcus; Email: no email provided; course: REQ-01; school: 'Matrix'} Teacher {Name: Hilda; Email: no email provided; course: MAT-4; school: 'Matrix'} Teacher {Name: Hansy; Email: hansy@gmail.com; course: PR-9; school: 'Gaspesie'} Teacher {Name: Rony; Email: rony@gmail.com; course: GX-10; school: 'Lasalle'} 4. For students, we need to maintain the courses taken and their respective grades; add a course with grade, print all courses taken and the average grade. Assume that a student takes no more than 10 courses for the entire program. 5. For teachers, we need to maintain the courses taught currently, and able to add or remove a course taught. Assume that a teacher teaches not more than three (3) courses concurrently. can you please provide its solution as soon as possible as it would help me better . if you want to help me you can upload the code in the comment section. thanksss.
@roaa4872
@roaa4872 4 жыл бұрын
that was really helpful I'm so thankful
@DiaborMagics
@DiaborMagics Ай бұрын
I'm trying to move on from coding everything in just the main method which becomes very messy... looked up a bit on methods and classes and apparently superclasses exist. This whole video I'm just asking myself several variations of "why?" question 1: why did we make the variables in the superclass public final? (yeah, the assignment said so. but why?) question 2: what's the point of (this.)brand = brand in the constructor if they already exist in the class and is passed to the constructor anyway? Seems like we're just repeating ourselves for no reason. question 3: what is a constructor even for? We have a class we can call and it has the variables we made, don't we? quetion 4: why do we put the type of the variable (string, double, etc) in the parentheses for a method or constructor, if the type has already been declared when initiating them in the class? For example public final weight; followed by Running (double weight, etc) {} Why we/I would even do any of this completely eludes me.
@manishmadan5543
@manishmadan5543 4 жыл бұрын
Thanks Lee !
@FiveJungYetNoSmite
@FiveJungYetNoSmite 4 жыл бұрын
Very good thanks
@yazanmehdawe4090
@yazanmehdawe4090 3 жыл бұрын
Guys I need your help, I am trying to make a Database class where it should have all my data from the other classes, but I can only use the extend method once, so like class database extends myotherclass, how can I use it multiple times in one class Thank you
@ianubc
@ianubc 3 жыл бұрын
Really useful content! I have a question, I want to make a meal planner that can keep track of recipes for a certain period of time. My question is I think I need a class called "ingredient" and a class called recipe and each recipe can hold ingredients, each I gredient would have a cost per unit, a name, if it's organic, etc. And the recipe can go through its ingredients and add up the total cost given it knows how much it is per unit and how many units it needs, and you could print the ingredient list. (I want to start simple and not worry about the instructions yet. Or assigning the instance of a recipe to a day of the week) Any help would be appreciated!
@zxnnightstalker2289
@zxnnightstalker2289 3 жыл бұрын
That's what I'm looking for!
@nguyenthu911
@nguyenthu911 4 жыл бұрын
More complex practices please
@andreigiura
@andreigiura 4 жыл бұрын
Hi Alex, grate video
@rohansingh5975
@rohansingh5975 3 жыл бұрын
Can you make tutorial for Android Studio ???????
@artemandrianov8700
@artemandrianov8700 4 жыл бұрын
What keyboard are you using? I like the sound of the typing.
@Amera-vt6xo
@Amera-vt6xo 4 жыл бұрын
Very helpful
@jeraldcapit936
@jeraldcapit936 3 жыл бұрын
May I ask why this is run to my program?
@alvaro1379
@alvaro1379 Жыл бұрын
i hate the fact that the assignmentd that i have to do for my uni, are soooo much harder than this
@odai11
@odai11 4 жыл бұрын
Awesome video bro ❤️
@exceptionallymarden3779
@exceptionallymarden3779 Жыл бұрын
Hey! I joined your facebook group! It does seem like there is a ton of spam posts from people who have randomly joined. I can't find any posts about Java. Any way to fix this? Thank you!
@tarikgulsever5191
@tarikgulsever5191 4 жыл бұрын
Alex brother . Can you teach us how to read table from web application. Please...
@maherwrites8931
@maherwrites8931 4 жыл бұрын
You're amazing bro👌😘
@mehrabhasantanim338
@mehrabhasantanim338 4 жыл бұрын
This on is subcontractor calling I am looking for void type method calling
@zachbourque6173
@zachbourque6173 4 жыл бұрын
I love you, Alex
@user-hu4yp4ml3c
@user-hu4yp4ml3c 3 жыл бұрын
YOU ARE THE BEEEEEST !!!
@I3uzzzzzz
@I3uzzzzzz 4 жыл бұрын
So when you do super(x,y) is super basically the superclass without needing to write out the name?
@ariton2990
@ariton2990 4 жыл бұрын
Super keyword refers to the parent class. As you saw Shoe class has a constructor with parameters. When he created class Walking, he extended Shoe, so now Walking is a child class of Shoe. But since Shoe has a constructor with parameters, it is necessary to invoke it in all child classes of the Shoe class. That's why he did super(brand, size); in the constructor of the Walking class. With super() he called constructor of a parent class Shoe and passed the required arguments. In this case it is absolutely necessary to call constructor of the parent class so you can pass in the arguments to it's constructor. However if the constructor of Shoe did not have any parameters, then call of the parent's constructor is not neccessary(the default one will get called automaticly). Hope this clears it. If you have more questions, ask me.
@I3uzzzzzz
@I3uzzzzzz 4 жыл бұрын
@@ariton2990 thanks dude
@null5573
@null5573 4 жыл бұрын
@@ariton2990 thank
@rittenbrake1613
@rittenbrake1613 4 жыл бұрын
Java is nothing without your face
@prakashankar.photography
@prakashankar.photography 2 жыл бұрын
Subscribed :)
@jsviolet
@jsviolet 3 жыл бұрын
Yo that's just like my teacher said..
@leonard0104
@leonard0104 2 жыл бұрын
3:44 who the F is brandon??
@gnuym2895
@gnuym2895 4 жыл бұрын
Insane
@SAM-ol5ip
@SAM-ol5ip Жыл бұрын
GOAT
Final Keyword In Java Tutorial #89
7:25
Alex Lee
Рет қаралды 65 М.
Inheritance in Java Tutorial #86
10:34
Alex Lee
Рет қаралды 385 М.
How to Use VS Code REST Client Extension To Test APIs ?
1:38
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 79 М.
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2,1 МЛН
Inheritance Part 1:  Super and Sub Classes (Java)
5:39
Nathan S
Рет қаралды 56 М.
Super Keyword in Java Full Tutorial - How to Use "super"
11:33
Coding with John
Рет қаралды 206 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 479 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 945 М.
Java Super Keyword Tutorial #87
15:00
Alex Lee
Рет қаралды 229 М.
Java OOP in 10 Minutes (Java Object Oriented Programming) #95
10:05
#48 What is Inheritance in Java
8:47
Telusko
Рет қаралды 132 М.