CommerceClasses And Modules MCQs
Practice Classes And Modules MCQs for competitive exams.
Classes And Modules MCQs
Practice questions from this topic.
If A is the superclass and B is the subclass, then subclass inherting the superclass can be represented as
- A. B=inherit(A)
- B. B=A.inherit()
- C. B.prototype=inherit(A)
- D. B.prototype=inherit(A.prototype)
Correct Answer: C
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 subclass
Correct Answer: A
The property of JSON() method is:
- A. it can be invoked manually as object.JSON()
- B. it will be automatically invoked by the compiler
- C. it is invoked automatically by the JSON.stringify() method
- D. it cannot be invoked in any form
Correct Answer: C
The meaning for Augmenting classes is that
- A. objects inherit prototype properties even in dynamic state
- B. objects inherit prototype properties only in dynamic state
- C. objects inherit prototype properties in static state
- D. None of the mentioned
Correct Answer: A
The basic difference between JavaScript and Java is
- A. There is no difference
- B. Functions are considered as fields
- C. Variables are specific
- D. Functions are values, and there is no hard distinction between methods and fields
Correct Answer: D
Consider the following code snippet : var o = new F () ; o . constructor === F The output would be :
- A. false
- B. true
- C. 0
- D. 1
Correct Answer: B
The keyword or the property that you use to refer to an object through which they were invoked is
- A. from
- B. to
- C. this
- D. object
Correct Answer: C
The behaviour of the instances present of a class inside a method is defined by
- A. Method
- B. Classes
- C. Interfaces
- D. Classes and Interfaces
Correct Answer: B