Java Fundamentals

Test your knowledge of Java syntax,variables,and control structures.

1. What is the entry point of a Java program?
2. Which keyword is used to declare a class in Java?
3. What is the default value of an int instance variable?
4. Which of these is a primitive data type in Java?
5. What does the 'static' keyword mean for a method?
6. Which operator is used for string concatenation in Java?
7. What is the output of System.out.println(5 + 2 + "Java");?
8. Which loop structure is best for when you don't know the number of iterations in advance?
9. Which keyword is used to inherit a class in Java?
10. What is the superclass of all classes in Java?
11. Which of the following are valid Java identifiers?
12. Which keywords are used for access control in Java?
13. Which of these are checked exceptions?
14. Which of the following interfaces extend the Iterable interface, allowing traversal with an enhanced for-loop?
15. Which of these are valid ways to create a String in Java?
16. Java is a case-sensitive language.
17. The 'final' keyword can be applied to a class, method, and variable.
18. A constructor can return a value.
19. What keyword is used to handle exceptions in Java (starts the block where exceptions may occur)?
20. Name the standard method used to print a line of text to the console (full method name).
Answered 0 of 0 — 0 correct