//****************************************** 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");
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
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
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.
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.
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
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)
Amazing video as always bro! One question, how do you get Eclipse to auto-complete 'System.out.println();' when you type sysout? I can't figure out how to. Thanks!!
//******************************************
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
WTH... I have read full chapters on this topic and didn't come away with this clarity. You have earned a subscriber.
Missed classes because I was sick and your videos helped me so much in so little time. The best 🙌🏼
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
"and they might think ur crazy".. bro ur the goat of explaining java
I love you. Someone who can actually explain things!!!
such a godlike explanation what the heck
CRAZY
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
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
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.
Thank you man for this new old tutorial
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.
Cristal clear! Thanks bro!
thank you bro, I am using your videos to learn java, very helpfull to me, good luck, keep up the good work !!!
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.
Best video to learn about Abstract Classes.
Brilliant! Keep it up!
the car dealership example
This was a great example
thanks that helped me remember the concept
thanks for helping us.
Another great and easy to understand video
Great explanation, very helpful!
You are a legend!
i finally understand abstract class, like the "why?" of this topic
awesome video
Another awesome video thanks bro :)
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.
youre just great .
Love you, from France
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
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 ❤💛💚
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
Thanks for the video and the knowledge you offer!
THANKS BRO!
number one
Nice.
nice video
love you bro
Thank you very much!!
Bro is the best
Thank you bro
perfect
Thanks for clear cut explanation.
nice
super!
best person in the world
Thank you Bro, you're the best!
thank you !!
cool bro
thanks bro
great ! thanks !
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 ever
Thanks for the explanation
Super
easy to understand thankyou
Very helpful, thank you.
thank you
Thanks for the video
thanks
right on the point no bullshit
Thanks for the class
Do we have to make our superclass abstract in every situation?
so vehicle. much abstract
👏👏👏👏
crazy
Nice job again!!
👍👍👍👍👍👍
cool vid
Thanks
thank youu broooo
Thanx for this. Under what circumstances does a class become abstract?
learned it whole
Currently our subject lessons right now
Thanks broh
Nice bro, thanks!
i'm the 50000TH viewer !! thanks broo!!
thank you brooooooooo
Thank you so much sir.
very useful
And then God sent us Bro
Thank you so much
Yea!! 1 prayer!!!
thanks for the prayer Lucy!
best broooo
Thanks Bro
bro's coding
In BroCode we trust
😃
Why use abstract class over interface?
Amazing video as always bro! One question, how do you get Eclipse to auto-complete 'System.out.println();' when you type sysout? I can't figure out how to. Thanks!!
you have to utilize the command (ctrl + space ) after the sysout
@@johneltins9822 Thankyou so much!! It works!
type sout
just type syso ctrl+space...I am also new and have completed Java upto OOp implementation soon will start 2-d graphics
need new videos!
I started learning Java through an online course, which is terrible at explaining things
broo
Thank you so much 😿💕