0

programming languages Online Quiz - 62

Description: programming languages Online Quiz - 62
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

What is the output of following block of program ? boolean var = false; if(var = true) { System.out.println(“TRUE”); } else { System.out.println(“FALSE”); }

  1. TRUE

  2. true

  3. FALSE

  4. Compilation Error

  5. Run time Error


Correct Option: A

A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector new vector(5,10)

  1. The element will not be successfully added

  2. ArrayIndexOutOfBounds Exception

  3. The Vector allocates space to accommodate up to 15 elements

  4. Nothing will happen


Correct Option: C

Is sizeof a keyword ?

  1. True

  2. False


Correct Option: B

Which is false about garbage collection in java

  1. the heap space occupied by an un-referenced object can be recycled and made available for subsequent new objects

  2. When the total memory allocated to a Java program exceeds some threshold the garbage coollector is invoked

  3. the program does not suspend during garbage collection

  4. garbage collection requires extra memory


Correct Option: C

document.getElementById("trial").innerHTML() is a valid statement

  1. True

  2. False


Correct Option: B

window.location.href="www.google.com". The given statement when executed would result in one of the following:

  1. It will give an error

  2. It will execute and nothing will happen

  3. It will execute and www.google.com is going to open

  4. None of The above


Correct Option: C

AI Explanation

To answer this question, let's analyze the given statement:

window.location.href="www.google.com"

This statement assigns the value "www.google.com" to the href property of the window.location object. The window.location object represents the current URL of the browser window.

When this statement is executed, it will navigate the browser to the URL specified, which in this case is "www.google.com". So, the correct answer is option C - It will execute and www.google.com is going to open.

onUnload event of Javascript is fired in which of the following conditions

  1. When browser is closed

  2. When the page reloads as well.

  3. Only when you navigate out of the page.

  4. All Of the Above


Correct Option: D

The following piece of javascript code is going to work fine. function tryVariableArguments() { var intCnt = 0; for (intCnt = 0; intCnt < tryVariableArguments.arguments.length; intCnt++) { alert(tryVariableArguments.arguments[intCnt]); } } Trial Page tryVariableArguments('1','2','3'); tryVariableArguments('1','2'); tryVariableArguments();

  1. True

  2. False


Correct Option: B

Javascript does not distinguish between name of a function and a variable

  1. True

  2. False


Correct Option: B

innerHTML, innerText, outerHTML and outerText. What are these of Element object

  1. Methods

  2. Properties

  3. Objects

  4. None of The above


Correct Option: B

All the HTML objects like Form, Select, Textarea and others are implicitly an instance of Element as well

  1. True

  2. False


Correct Option: B

It is possible to add custom methods and properties in pre-existing objects like String, Math and others

  1. True

  2. False


Correct Option: B

One can add custom method and properties to objects in javascript without using prototype as well.

  1. True

  2. False


Correct Option: B

Which of the following HTTP response codes indicate a successful response from the server

  1. 200

  2. 304

  3. 404

  4. None of The above


Correct Option: A

onreadystatechange is a method of XMLHttpRequest Object

  1. True

  2. False


Correct Option: B

POST requests can also be send through the open method of the XMLHttpRequest Object

  1. True

  2. False


Correct Option: B

URL accessed through XMLHttpRequest's open method is stored in the history of the browser.

  1. True

  2. False


Correct Option: B

parseJSON is a standard function available in javascript like alert, eval and others.

  1. True

  2. False


Correct Option: B

Please select right set of technologies that are required for implementing Dynamic Content or DHTML in your application

  1. HTML

  2. CSS

  3. Javascript

  4. Ajax


Correct Option: A,B
- Hide questions