JavaScript and Java Fundamentals Quiz
Test your knowledge of JavaScript web development concepts including DOM manipulation, XMLHttpRequest, events, and Java fundamentals including collections, control flow, and memory management.
Questions
What is the output of following block of program ? boolean var = false; if(var = true) { System.out.println(“TRUE”); } else { System.out.println(“FALSE”); }
- TRUE
- true
- FALSE
- Compilation Error
- Run time Error
A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector new vector(5,10)
- The element will not be successfully added
- ArrayIndexOutOfBounds Exception
- The Vector allocates space to accommodate up to 15 elements
- Nothing will happen
int x = 2; switch (x) { case 1:System.out.println(“1?); case 2: case 3:System.out.println(“3?); case 4: case 5:System.out.println(“5?); }
- No output
- 3 and 5
- 1,3 and 5
- 0
- 2
Is sizeof a keyword ?
- True
- False
Which is false about garbage collection in java
- the heap space occupied by an un-referenced object can be recycled and made available for subsequent new objects
- When the total memory allocated to a Java program exceeds some threshold the garbage coollector is invoked
- the program does not suspend during garbage collection
- garbage collection requires extra memory
document.getElementById("trial").innerHTML() is a valid statement
- True
- False
window.location.href="www.google.com". The given statement when executed would result in one of the following:
- It will give an error
- It will execute and nothing will happen
- It will execute and www.google.com is going to open
- None of The above
onUnload event of Javascript is fired in which of the following conditions
- When browser is closed
- When the page reloads as well.
- Only when you navigate out of the page.
- All Of the Above
The following piece of javascript code is going to work fine. Trial Page
- True
- False
Javascript does not distinguish between name of a function and a variable
- True
- False
innerHTML, innerText, outerHTML and outerText. What are these of Element object
- Methods
- Properties
- Objects
- None of The above
All the HTML objects like Form, Select, Textarea and others are implicitly an instance of Element as well
- True
- False
It is possible to add custom methods and properties in pre-existing objects like String, Math and others
- True
- False
One can add custom method and properties to objects in javascript without using prototype as well.
- True
- False
Which of the following HTTP response codes indicate a successful response from the server
- 200
- 304
- 404
- None of The above
onreadystatechange is a method of XMLHttpRequest Object
- True
- False
POST requests can also be send through the open method of the XMLHttpRequest Object
- True
- False
URL accessed through XMLHttpRequest's open method is stored in the history of the browser.
- True
- False
parseJSON is a standard function available in javascript like alert, eval and others.
- True
- False
Please select right set of technologies that are required for implementing Dynamic Content or DHTML in your application
- HTML
- CSS
- Javascript
- Ajax