//****************************************** public class Main { public static void main(String[] args) {
// abstract = abstract classes cannot be instantiated, but they can have a subclass // abstract methods are declared without an implementation
//Vehicle vehicle = new Vehicle(); Car car = new Car();
car.go(); } } //****************************************** public abstract class Vehicle {
abstract void go(); } //****************************************** public class Car extends Vehicle{ @Override void go() { System.out.println("The driver is driving the car");
I started learning Java through an online course, which is terrible at explaining things, leaving me confused lot of the time. Then comes BRO, who explains everything so simply and elegantly that I have no problems understanding it! Thank you BRO!
Hi, do what I do. Goto settings and select playback speed. I lowered it to 70%,S, that way I can follow what he is saying one way or another. good luck
Bro; you have no idea how much you've helped me so far to learn Java. Any doubts I come here, looking for an example that you have,no doubt thank you, sincerely. - Never thought a bro' would save my ass this way. Love you and admire you.
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
This my 6th/7th video in this channel, Man!!!! I got to say this, yo explanations are spot on and explaining in a logical way make really sense on each of the topics. Good luck and keep doing
I understand abstraction like, A parent(superclass) has money and wants to give this money( variables/Methods) to his children and each child uses his money as he wants!
I have been avoiding any instance that would make me use abstract classes cos the articles I read before never explained it clearly but I think this is the safest way to me now. I have been creating classes and just making things simple by using access modifiers, but yeah, thumb up Bro.
Great video! For the ones out there who are quite confused with the given example, another similar code snippet is like this: //Vehicle(superclass) //Bike, Car, Boat (all are subclasses and uses the extends keyword) Vehicle a = new Car(); Vehicle b = new Bike(); Vehicle c = new Boat(); Vehicle[] test = {a, b, c}; This is much more understandable and less confusing for some. However, if there's a unique method present on one of those three subclasses above (for example, like void printCarModel() in the Car class only) that is NOT present in the Vehicle superclass, you would need to use the example code shown in the video. If we try to access the printCarModel() method: a.printCarModel(); It would result in an error since the type of 'a' is 'Vehicle' and not 'Car' (because we did Vehicle a = new Car(); and there's no such printCarModel() in Vehicle) Use: Car a = new Car(); instead to access that unique method.
You could also typecast the vehicle into a car to access the method I also have one question that I'm confused about abstract classes What's the point of them? In this video he said it's to add a further layer of security to prevent someone using too vague or broad of a class and trying to make an object out of that but can't you just solve that by not making that class at all Is it because we need the superclass because it makes writing subclasses quicker because we can just use the super keyword to access all the general shared information that the subclasses have with the superclass, that way it encapsulates code more or are there any other reasons
I LOVE these explanations, the example with the dealership and the vagueness was extraordinary. 💙 Just one thing that's still keeping me from fully diving into everything: I sometimes miss the practical use. Why would I wanna prevent somebody from instantiating the abstract class? Why do I need to send values to a constructor and not just use the Main class? Any idea how to untie this knot in my brain (which lets me think a miss the very basics of Java)?
Thank you for this video, I'm just about done reading the pdf I have in my coding class because it just goes on; I've never been huge on reading instructions. This gets straight to the point and makes the purpose of it obvious.
good stuff every time you hit the nail on the head quickly and clearly. let me know when your bible is ready i need a copy... Bro Code Bible,... never leave the house without it
Hello Arka! Good questions 1. An abstract class will need static methods since we cannot create an instance of an abstract class 2. A normal class cannot have abstract methods
Hi there was watching this on the playlist I've gotten confused with interfaces and abstraction Do you have any websites or videos explaining the main differences ? Thankyou in advance (videos are really helpful saving me on my CS degree as a first year xD)
//******************************************
public class Main {
public static void main(String[] args) {
// abstract = abstract classes cannot be instantiated, but they can have a subclass
// abstract methods are declared without an implementation
//Vehicle vehicle = new Vehicle();
Car car = new Car();
car.go();
}
}
//******************************************
public abstract class Vehicle {
abstract void go();
}
//******************************************
public class Car extends Vehicle{
@Override
void go() {
System.out.println("The driver is driving the car");
}
}
//******************************************
You sound very nice and attractive
such a godlike explanation what the heck
CRAZY
WTH... I have read full chapters on this topic and didn't come away with this clarity. You have earned a subscriber.
I started learning Java through an online course, which is terrible at explaining things, leaving me confused lot of the time. Then comes BRO, who explains everything so simply and elegantly that I have no problems understanding it! Thank you BRO!
I don't understand English a lot, but with this guy, I'm understanding 90%.
Muito obrigado ✌️
From Mozambique🇲🇿
Hey, Juvenal! How is your Java-learning going on?
@@shalomerror6236 it's going well
méquié Juvenal ainda fazes Java?
@@hero_bsb6314 parei há bom tempo.
Hi, do what I do. Goto settings and select playback speed. I lowered it to 70%,S, that way I can follow what he is saying one way or another. good luck
Missed classes because I was sick and your videos helped me so much in so little time. The best 🙌🏼
I love you. Someone who can actually explain things!!!
Bro; you have no idea how much you've helped me so far to learn Java. Any doubts I come here, looking for an example that you have,no doubt thank you, sincerely. - Never thought a bro' would save my ass this way. Love you and admire you.
"and they might think ur crazy".. bro ur the goat of explaining java
Honestly, your videos are saving me this semester. You explain it better than my professor, thank you for making content like this.
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
Just made a comment for prayer to TH-cam algorithm ❤❤❤❤❤
Your videos gives everyone a very clean start. This is great because we can easily build on that using other resources.
thank you bro, my professor didnt explain this well and now i totally get it
the car dealership example
WOW..now is so easy for understanding!Thanks
thank you so much for the explanation, you are the best!!! You did in 5 minutes what my professor was not able to do the whole semester.
This my 6th/7th video in this channel, Man!!!! I got to say this, yo explanations are spot on and explaining in a logical way make really sense on each of the topics. Good luck and keep doing
I understand abstraction like, A parent(superclass) has money and wants to give this money( variables/Methods) to his children and each child uses his money as he wants!
thank you bro, I am using your videos to learn java, very helpfull to me, good luck, keep up the good work !!!
I have been avoiding any instance that would make me use abstract classes cos the articles I read before never explained it clearly but I think this is the safest way to me now. I have been creating classes and just making things simple by using access modifiers, but yeah, thumb up Bro.
Another great and easy to understand video
Great video! For the ones out there who are quite confused with the given example, another similar code snippet is like this:
//Vehicle(superclass)
//Bike, Car, Boat (all are subclasses and uses the extends keyword)
Vehicle a = new Car();
Vehicle b = new Bike();
Vehicle c = new Boat();
Vehicle[] test = {a, b, c};
This is much more understandable and less confusing for some.
However, if there's a unique method present on one of those three subclasses above (for example, like void printCarModel() in the Car class only) that is NOT present in the Vehicle superclass, you would need to use the example code shown in the video. If we try to access the printCarModel() method:
a.printCarModel();
It would result in an error since the type of 'a' is 'Vehicle' and not 'Car' (because we did Vehicle a = new Car(); and there's no such printCarModel() in Vehicle)
Use:
Car a = new Car(); instead to access that unique method.
You could also typecast the vehicle into a car to access the method
I also have one question that I'm confused about abstract classes
What's the point of them? In this video he said it's to add a further layer of security to prevent someone using too vague or broad of a class and trying to make an object out of that but can't you just solve that by not making that class at all
Is it because we need the superclass because it makes writing subclasses quicker because we can just use the super keyword to access all the general shared information that the subclasses have with the superclass, that way it encapsulates code more or are there any other reasons
Best video to learn about Abstract Classes.
I LOVE these explanations, the example with the dealership and the vagueness was extraordinary. 💙
Just one thing that's still keeping me from fully diving into everything: I sometimes miss the practical use. Why would I wanna prevent somebody from instantiating the abstract class? Why do I need to send values to a constructor and not just use the Main class? Any idea how to untie this knot in my brain (which lets me think a miss the very basics of Java)?
Thank you for this video, I'm just about done reading the pdf I have in my coding class because it just goes on; I've never been huge on reading instructions. This gets straight to the point and makes the purpose of it obvious.
Nice Bro
Cristal clear! Thanks bro!
Good videos , very helpful , we need a mysql tutorial to complete the full stack dev
thanks for helping us.
Thanks, Bro! ☕ You're awesome!
Thank you man for this new old tutorial
awesome video
Great explanation, very helpful!
i finally understand abstract class, like the "why?" of this topic
anjay, langsung paham gw, keren bang, lanjutkan kerjamu
Another awesome video thanks bro :)
Brilliant! Keep it up!
thanks you, I am brasilian and dont understanding ingles very, but you tell so good!
good stuff every time you hit the nail on the head quickly and clearly. let me know when your bible is ready i need a copy... Bro Code Bible,... never leave the house without it
Thou shall not use many 'else if' statements
Nice bro... this made it sooo simple to understand! Thx
Thanks for the video and the knowledge you offer!
simple and awesome like always
This was a great example
thanks that helped me remember the concept
Good explanation. Do you need to have a regular method inside an abstract class since an abstract class cannot instantiate objects?
best channel on youtube.
That's awesome
Thanks for clear cut explanation.
Thanks for the explanation
easy to understand thankyou
nice ❤💛💚
Many thanks! Stay healthy, stay happy, Bro Teacher!
Very helpful, thank you.
Thanks for the video
Perfect
You are a legend!
great
number one
Sir, I have two questions:
1. Can an abstract class have a normal (non-abstract) method?
2. Can a normal class have an abstract function?
Hello Arka! Good questions
1. An abstract class will need static methods since we cannot create an instance of an abstract class
2. A normal class cannot have abstract methods
@@BroCodez Thanks!!! 👍
@@arkamukhopadhyay2177 abstract class can hove normal method
nice job bro
Extraordinary work
great video , thank you !
This really helped me. Thank you.
Love you, from France
youre just great .
Thank you very much!!
Nice.
Thanks for the class
very well explained!
nice video
Clear explanation. Thank you Bro -:)
Hi there was watching this on the playlist I've gotten confused with interfaces and abstraction Do you have any websites or videos explaining the main differences ?
Thankyou in advance (videos are really helpful saving me on my CS degree as a first year xD)
best person in the world
liking it
Bro is the best
Thanks, Bro!
appreciate it!
👏👏👏👏
great ! thanks !
perfect
thanks bro
THANKS BRO!
nice
Super
so vehicle. much abstract
Thanks
love you bro
Thank you!
👍👍👍👍👍👍
Nice job again!!
super!
right on the point no bullshit
Hey you many thanks to you!!!
Thank you
best ever
crazy
Thank you so much sir.
Do we have to make our superclass abstract in every situation?
thank you bro