MCQ Bank
Let suppose int a, b, c, d, e; a = b = c = d = e = 42; This can be interpreted by the complier as
- A) a = (b = (c = (d = (e = 42))));
- B) (a = b = (c = (d = (e = 42))));
- C) a = b = (c = (d = (e = 42)));
- D) (a = b) = (c = d) = (e = 42);
A class is _____________.
- A) a built in function
- B) a user defined data type
- C) a member function
- D) an array
public or private keywords can be ______________
- A) written only twice in the class declaration
- B) written only for once in the class or structure declaration
- C) written multiple times in the class or structure declaration
- D) written outside the class
Consider the following code segment. Which of the following will be called while executing code at line 2? String s1 , s2; s1 = s2 ;
- A) Assignment operator
- B) Copy constructor
- C) Default constructor
- D) Parameterized constructor
In a regular expression, what does \d represent?
- A) Any digit (0–9)
- B) A whitespace character
- C) Any letter
- D) A special symbol
In JQuery, innerHeight() method returns:
- A) height of an element excluding padding
- B) height of an element excluding border
- C) height of an element including padding
- D) height of an element including border
The children() method selects:
- A) Direct child elements only
- B) Parent elements
- C) Sibling elements
- D) All elements in DOM
Which part of a variable is hoisted in JavaScript?
- A) Declaration (variable name)
- B) Assignment (value storage)
- C) Initialization (assigning value)
- D) Expression
In DOM tree, an ancestor can be ___________.
- A) Child, grand-child, great grand-child and so on.
- B) All of the given options
- C) Parent, grand parent, great grand-parent and so on.
- D) Siblings
What does points.sort(function(a,b){return a-b}) do?
- A) Sorts the array randomly
- B) Sorts the array alphabetically
- C) Sorts the array in ascending numeric order
- D) Sorts the array in descending order
______________________ is used to Insert content at the beginning of the selected elements.
- A) After()
- B) Prepend()
- C) Before()
- D) Append()
______________________ is used to Insert content at the end of the selected elements.
- A) Prepend()
- B) Before()
- C) After()
- D) Append()
GET request sends data via:
- A) Header only
- B) Cookie
- C) URL
- D) Body
What is the best way to create an object in JavaScript?
- A) new Object()
- B) {} (object literal)
- C) create()
- D) Object()
How can you determine if a variable is an array in JavaScript?
- A) Inspecting the variable's constructor
- B) Using the typeof operator
- C) Checking if the variable's type is "array"
- D) Using the isArray() function
Which of the following is syntax of creating XMLHttpRequest?
- A) new AJAX()
- B) new HTTPRequest()
- C) createRequest()
- D) new XMLHttpRequest()
Which loop evaluates the condition after executing the code block?
- A) for loop
- B) do/while loop
- C) if statement
- D) while loop
The unary + operator is used to:
- A) Convert an object into an array
- B) Convert a number into a string
- C) Convert a string into a number
- D) Convert a boolean into a string
undefined means:
- A) String value
- B) Value not assigned yet
- C) Null value
- D) Number value
What is the function of document ready event?
- A) None of the given options
- B) To prevent an event from performing its default action
- C) To prevent any jQuery code from running after the document has finished loading
- D) To prevent any jQuery code from running before the document is finished loading