Home / Programming MCQs / JAVA MCQs / Question
R
Q. What will be the output of following Java code?
import java.util.Hashtable; public class HashTableClass { int hashcode; HashTableClass(int hashcode) { this.hashcode = hashcode; } public int hashCode() { return hashcode; } public String toString() { return hashcode + " "; } public static void main(String[] args) { Hashtable ht = new Hashtable(); ht.put(new HashTableClass(10), "Java"); ht.put(new HashTableClass(3), "C"); ht.put(new HashTableClass(4), "C++"); ht.put(new HashTableClass(5), "Ruby"); ht.put(new HashTableClass(6), "null"); System.out.println(ht); } }
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
A Class in Java is like a ____.
Which of these class contains the methods print() & println()?
What will be the output of the following code
Which of the following is not an access modifier?
What is multithreaded programming?
Iterator returned by CopyOnWriteArrayList is?
Generally string is a sequence of characters, But in java, string is an _______
Which concept of Java is a way of converting real world objects in terms of class?
What is the output of a Bitwise AND (&) operation if one of the inputs/operands is 0?
Discusssion
Login to discuss.