Multiple choice question
Does an object of type class can be assigned to a variable of its sub-class type?
What will be the result of the following code:
class A {
public static void main(String [] args) {
B b = new A();
}
}
class B extends A {}