Answer and Explanation:
Abstract class Point {
int x = 1, y = 1;
void move(int dx, int dy) {
x += dx;
y += dy;
alert();
}
abstract void alert();
}
abstract class Colored Point extends Point {
int color;
}
class Simple Point extends Point {
void alert() { }
}
Here, a class Point is proclaimed that must be declared abstract, in light of the fact that it contains an assertion of a unique strategy named alert. The subclass of Point named Colored Point acquires the dynamic technique alert, so it should likewise be proclaimed theoretical. Then again, the subclass of Point named Simple Point gives a usage of alarm, so it need not be dynamic.
The statement:
Point p = new Point();
would bring about an aggregate time mistake; the class Point can't be launched in light of the fact that it is theoretical. Be that as it may, a Point variable could accurately be instated with a reference to any subclass of Point, and the class Simple Point isn't digest, so the statement:
Point p = new Simple Point();
would be correct. Instantiation of a Simple Point causes the default constructor and field initializers for x and y of Point to be executed.