Java MCQ Test: Java MCQs - Practice Questions
1. What will this code print? int arr[] = {1, 2, 3, 4, 5}; System.out.println(arr[2]);
2. Which interface does java.util.Hashtable implement?
3. What is the initial capacity of Java's Vector class?
4. In Java, which of these can be used to achieve polymorphism?
5. In Java, an array is indexed starting from what number?
6. Which company first developed Java?
7. Which one is a valid declaration of a boolean?
8. Which of these is a valid way to create a thread?
9. What is the output of: System.out.println(1 + 2 + "3");
10. Which of these keywords is used to define a package in Java?