-
Managing Inheritance relationship between Classes and Sub-classes
The central new idea in OOP is to allow classes to express similarities among objects that share some, but not all, of their structure and behavior. Such similarities can be expressed using inheritance and polymorphism. Explain how the special variables this and super help manage the inheritance relationship between classes and sub-classes. Do they (i.e., this and super) also help polymorphism? Explain....
-
Explain Object Construction in simple terms
In Java, object types (i.e., classes) must be explicitly constructed for initialization. Explain object construction. Then, state the name of the mechanism for object destruction, and explain in simple terms how it works.
-
Explain the mechanism to create an object.
In Java, a class is a type, similar to the built-in types int and boolean. Declaring a variable does not create an object. Explain the mechanism to create an object.