More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Q2494. If we try to add duplicate key to the HashMap, What will happen ?
a. It will throw an exception. b. It won't add the new Element without any exception. c. The new element will replace the existing element. d. Compiler will identify the problem and will throw an error.
Ans. The new element will replace the existing element.
Help us improve. Please let us know the company, where you were asked this question :
a. HashMap came before HashTable. b. HashMap allows null values whereas Hashtable doesn’t allow null values. c. HashTable and HashMap allow Key-Value pairs. d. Hashtable is synchronized whereas HashMap is not.
Ans. HashMap came before HashTable.
Help us improve. Please let us know the company, where you were asked this question :
Q2499. Which of the following is not the use of this keyword ?
a. Passing itself to another method b. To call the static method c. Referring to the instance variable when local variable has the same name d. Calling another constructor in constructor chaining
Ans. To call the static method
Help us improve. Please let us know the company, where you were asked this question :
Q2506. Which of the following is not the advantage of Mocking frameworks ?
a. It helps testing the module independently b. It helps in faster unit testing c. It helps in testing code even when external dependencies like service calls are not working d. It helps in doing end to end Integration Testing
Ans. It helps in doing end to end Integration Testing
Help us improve. Please let us know the company, where you were asked this question :
Q2507. Which of the following is fastest to locate the DOM element ?
a. document.getElementById b. document.getElementByName c. document.ElementName.SubElementName d. They all result in similar performance in retrieving the DOM element.
Ans. document.ElementName.SubElementName
Help us improve. Please let us know the company, where you were asked this question :
Q2509. Why should we have Javascript method definitions within HTML Head section ?
a. Its safe to have javascript code within head section b. Head section gets loaded even if there is any error in loading HTML page c. Head section gets executed first and hence assure that js method definition will be loaded before they are called d. So that we can have method definition and method call at the same place
Ans. Head section gets executed first and hence assure that js method definition will be loaded before they are called
Help us improve. Please let us know the company, where you were asked this question :
Q2512. How can we execute a Java class independently if it doesn't have a static main method ?
a. By initiating the flow in any of the static method b. By initiating the flow in any of static block c. By initiating the flow in any other instance method named as main d. By initiating the flow in any other instance method named as main and making it final
Ans. By initiating the flow in any of static block
Help us improve. Please let us know the company, where you were asked this question :