Comment line 1.
Comment line 2.
Comment line 3.
Comment line 4.
One object created.
Two objects created.
Three objects created.
One reference variable is created.
Two reference variables created.
Three reference variables created.
Is also called a static member.
Is always a variable.
Is never a method.
Belongs to a single instance, not to the class as a whole.
Always represents an operation.
By modifying each other’s variables.
By modifying static member variables of each other’s classes.
By calling each other’s instance member methods.
By calling each other’s static member methods.
Class X extends Y
Class Y is superclass of X
Class Y is subclass of X
Objects of class X will contain variable value2.
X HAS A Other;
The code doesn’t compile, because package statement is second statement.
Import statement can never be first statement in a program file.
In Java, the extends clause is used to specify inheritance.
The subclass of a non-abstract class can be declared abstract.
All the members of the superclass are inherited by the subclass.
A final class can be abstract.
A class, in which all the members are declared private, cannot be declared public.
Inheritance defines a has-a relationship between a superclass and its subclasses.
Every Java object has a method named equals().
Every Java object has a method named length().
A class can extend any number of other classes.
A non-final class can be extended by any number of classes.
Subclasses must define all methods that the superclass defines.
It is possible for a subclass to define a method with same name and parameters as a method that superclass defines.
A subclass cannot access the private members of superclass without using public members of parent class.
It is possible for two classes to be superclass of each other.
The Sub class is a legal subclass of Super.
The statement sb.fly() is legal.
The statement s.j = 5; is legal.
The statement s.gravity(); is legal.
The statement sb.i = 3 ; is legal.
Private methods cannot be overridden in subclasses.
A subclass can override any method in a non-final superclass.
The parameter list of an overriding method must be a subset of the parameter list of the method that it is overriding.
The overriding method can have a different return value than the overridden method.
It is not possible.
The code will fail to compile, since the max() method in B passes the arguments to the calling method in the wrong order.
The code will fail to compile, owing to a call to a max() method being ambiguous.
The code will compile and will print 13 when run.
The code will compile and will print 23 when run.
The code will compile and will print 29 when run.
The code will compile and will print 39 when run.