Abstract Classes
Abstract class is basically never be instantiated. its mainly purpose of the mission of life .that\'s the soul purpose of them .
We have a code for the abstract class :
abstract class Car {
private double price;
private Color carColor;
private String model;
private String year;
public abstract void goFast();
public abstract void goUpHill();
public abstract void impressNeighbors();
// Additional, important, and serious code goes here
}
When we execute this code its working fine .but when ever we instantiated car in th another body of code its gives us a compiler error :
AnotherClass.java:7: class Car is an abstract
class. It can\'t be instantiated.
Car x = new Car();
1 error