1.
The four kinds of class members are

Instance methods, Instance fields, Static method, Dynamic method

Instance fields, Instance methods, Class fields, Class methods

Instance fields, Non-instance fields, Dynamic methods, Global methods

Global methods, Local methods, Dynamic methods, Static methods

2.
The properties of the objects act like different kinds of class members. They are

Public object, Private object, Protected object

Constructor object, Function object, Destructor object

Constructor object, Prototype object, Instance object

Instance method, Static object, Dynamic object

3.
The object whose properties are inherited by all instances of the class, and properties whose values are functions behaving like instance methods of the class, is

Instance object

Constructor object

Destructor object

Prototype object

4.
Which are usually variables that are used internally in object methods and also are globally visible variables?

Object properties

Variable properties

Method properties

Internal properties

6.
Which is the correct code that returns a complex number that is the complex conjugate of this one?

Complex.prototype.conj = function() { return new Complex(this.r, -this.i); };

Complex.prototype.conj = function() { return Complex(this.r, -this.i); };

Complex.prototype.conj = function() { return (this.r, -this.i); };

Complex.prototype.conj = function() { new Complex(this.r, -this.i); };

8.
What is the procedure to add methods to HTMLElement so that they will be inherited by the objects that represent the HTML tags in the current document?

HTMLElement.prototype

HTML.addmethods()

HTML.elements(add)

11.
To define each of the set classes as a property of the sets object (namespace) for the module, the statement is

Sets = sets.AbstractEnumerableSet.extend();

Sets.SingletonSet = sets.AbstractEnumerableSet.extend(...);

Sets.SingletonSet = sets.extend(...);

Sets = sets.extend(...);

12.
Consider the following statement

var Set = sets.Set;
var s = new Set(1,2,3);
What could be the efficiency quotient of the above two statements ?

The programmer imports at once the frequently used values into the global namespace

There is no efficiency quotient, the programmer tries to make it inefficient

The programmer needs to import the Sets everytime he wants to use it

All of the mentioned

13.
Modules that have more than one item in their API can

Assign itself to a global variable

Invoke another module of the same kind

Return a namespace object

Invoke another module of the same kind

14.
Consider the following code snippet

var sets = com.davidflanagan.collections.sets;
What is the programmer trying to do in the above code snippet?

Importing a single module

Importing a module partially

Importing a namespace

Importing the entire module

0Shares
0
Scroll to Top