Contents

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

b

Explanation: Objects of the class are also known as instances of the class. The behaviour of the instance of a class is defined by the class and is shared by all instances.


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

c

Explanation: ‘this’ keyword is used to refer to the object through which the properties or methods were invoked. This use of ‘this’ is a fundamental characteristic of the methods of any class.


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

d

Explanation: Java is an OOP programming language while JavaScript is an OOP scripting language. The basic difference between JavaScript and Java is that the functions are values, and there is no hard distinction between methods and fields.


The meaning for Augmenting classes is that………..
a) objects inherit prototype properties even in a dynamic state
b) objects inherit prototype properties only in a dynamic state
c) objects inherit prototype properties in the static state
d) object doesn’t inherit prototype properties in the static state

a

Explanation: JavaScript’s prototype-based inheritance mechanism is dynamic an object inherits properties from its prototype, even if the prototype changes after the object is created. This means that we can augment JavaScript classes simply by adding new methods to their prototype objects.


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

c

Explanation: A common use of JSON is to exchange data to/from a web server. When sending data to a web server, the data has to be a string. In that case json.strigify() is used to convert a javascript object into a string.


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

a

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.