COMPUTER PROGRAMMING FUNDAMENTALS
WHAT IS PROGRAMMING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
object
|
|
class
|
|
property
|
|
superclass
|
Detailed explanation-1: -A superclass is the class from which many subclasses can be created. The subclasses inherit the characteristics of a superclass. The superclass is also known as the parent class or base class. In the above example, Vehicle is the Superclass and its subclasses are Car, Truck and Motorcycle.
Detailed explanation-2: -A subclass inherits all of the public and protected members of its parent, no matter what package the subclass is in. If the subclass is in the same package as its parent, it also inherits the package-private members of the parent.
Detailed explanation-3: -Parent class is the class being inherited from, also called base class. Child class is the class that inherits from another class, also called derived class.
Detailed explanation-4: -In Java, a child class inherits its parent’s fields and methods, meaning it also inherits the parent’s constructor. Sometimes we may want to modify the constructor, in which case we can use the super() method, which acts like the parent constructor inside the child class constructor.