1.

When a class B can extend another class A, we say that?(a) A is the superclass and B is the subclass(b) B is the superclass and A is the subclass(c) Both A and B are the superclass(d) Both A and B are the subclassThe question was asked in an internship interview.I'd like to ask this question from Classes in JavaScript in chapter Classes and Modules in JavaScript of JavaScript

Answer»

The correct ANSWER is (a) A is the SUPERCLASS and B is the SUBCLASS

For EXPLANATION: Superclass is the class from which subclasses are defined. Subclasses are also called EXTENSIONS of superclass.therefore in the above scenario A will be superclass and B will be subclass.



Discussion

No Comment Found

Related InterviewSolutions