A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

1. 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
View Answer Report Discuss Too Difficult!
Answer: (b).Classes

2. 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
View Answer Report Discuss Too Difficult!
Answer: (c).this

3. Consider the following code snippet :

var o = new F();
o.constructor === F

The output would be :
a. false
b. true
c. 0
d. 1
View Answer Report Discuss Too Difficult!
Answer: (b).true

4. 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
View Answer Report Discuss Too Difficult!
Answer: (d).Functions are values, and there is no hard distinction between methods and fields

5. 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
View Answer Report Discuss Too Difficult!
Answer: (a).objects inherit prototype properties even in dynamic state

6. 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
View Answer Report Discuss Too Difficult!
Answer: (c).it is invoked automatically by the JSON.stringify() method

7. 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
View Answer Report Discuss Too Difficult!
Answer: (a).A is the superclass and B is the subclass

8. 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);
View Answer Report Discuss Too Difficult!
Answer: (c).B.prototype=inherit(A);

9. The snippet that filters the filtered set is
a. var t=new FilteredSet(s, {function(s) {return !(x instanceof Set);});
b. var t=new FilteredSet{function(s) {return !(x instanceof Set);});
c. var t=new FilteredSet(s, {function(s) {return (x instanceof Set);});
d. var t=new FilteredSet(s, {function(s) {return x;});
View Answer Report Discuss Too Difficult!
Answer: (a).var t=new FilteredSet(s, {function(s) {return !(x instanceof Set);});

10. The method that can be used to create new properties and also to modify the attributes of existing properties is
a. Object.defineProperty()
b. Object.defineProperties()
c. Both Object.defineProperty() and Object.defineProperties()
d. None of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (c).Both Object.defineProperty() and Object.defineProperties()

Page 1 of 7