Abstract Class:: Class Private Private Private Int Public Int This This This
Abstract Class:: Class Private Private Private Int Public Int This This This
Abstract Class:: Class Private Private Private Int Public Int This This This
interface Vehicle {
String speedUp();
String slowDown();
}
private String showModel() {
return "Car Model : BMW 3200 CS";
}
static int getHorsePower(int rpm, int torque) {
return (rpm * torque) / 5252;
}
}
// constructors/getters
@Override
public String getBrand(String brand) {
return this.brand=brand;
}
@Override
public String speedUp() {
return "The car is speeding up.";
}
@Override
public String slowDown() {
return "The car is slowing down.";
}
public String turnAlarmOn() {
return Vehicle.super.turnAlarmOn() + " " + Alarm.super.turnAlarmOn();
}
@Override
public String turnAlarmOff() {
return Vehicle.super.turnAlarmOff() + " " + Alarm.super.turnAlarmOff();
}
class interface_methods
{
public static void main(String[] args) {
Vehicle car = new Car();
System.out.println(car.getBrand("CAR NAME : BMW"));
System.out.println(car.calling_privateMethod());
System.out.println(car.speedUp());
System.out.println(car.slowDown());
System.out.println(car.turnAlarmOn());
System.out.println(car.turnAlarmOff());
System.out.println("Calculated HorsePower of the Car is :
"+Vehicle.getHorsePower(2500,480));
}
}
@Override
public void practical() {
System.out.println("Practical Work in Lab");
}
}
public class partial_interface{