Комментарии:
//*************************************
public class Main {
public static void main(String[] args) {
// inheritance = the process where one class acquires,
// the attributes and methods of another.
Car car = new Car();
car.go();
Bicycle bike = new Bicycle();
car.go();
bike.stop();
System.out.println(car.doors);
System.out.println(bike.pedals);
}
}
//*************************************
public class Vehicle{
double speed;
void go(){
System.out.println("This vehicle is moving");
}
void stop(){
System.out.println("This vehicle is stopped");
}
}
//*************************************
public class Car extends Vehicle{
int wheels = 4;
int door = 4;
}
//*************************************
public class Bicycle extends Vehicle{
int wheels = 2;
int pedals = 2;
}
//*************************************
Tank you, very excellent explanation
ОтветитьLove from India❤
ОтветитьCorrection: in the void main, looking at the end of main, the "s" need to be removed from "car.doors" so the correct line should look like: System.out.println(car.door);
ОтветитьThank you so much for this tutorial!! It was very comprehensive and helpful.
Ответитьvery good video
helpful it is
👍
ОтветитьThanks
ОтветитьVery easiy explaing thank you
Ответить😎
ОтветитьThank you 🥰
ОтветитьYou made that look easy! Thank you!!!
Ответитьthank you
Ответитьgood stuff
ОтветитьYour 6-minute video made the bootcamp LMS content much easier to understand. Much appreciated!
ОтветитьI love u bro
Ответитьbro
Ответитьthanks for making it so easy to understand, awesome video, no more neither less information of what i needed
ОтветитьCool work!
Ответитьfucking goat.
Ответить