Java Basics and Fundamentals Quiz
Test your knowledge of Java basics including syntax, data types, operators, and control structures
This quiz is designed for beginners who want to test their understanding of Java fundamentals. It covers essential topics including variables, data types, operators, control flow statements, and basic OOP concepts.
Each question has detailed explanations to help you understand the concepts better and improve your Java programming skills.
- 01
What is the correct way to declare a main method in Java?
- 02
Which of the following is NOT a primitive data type in Java?
- 03
What is the default value of a boolean variable in Java?
- 04
Which keyword is used to inherit a class in Java?
- 05
What is the size of an int variable in Java?
- 06
Which loop is guaranteed to execute at least once?
- 07
What is the output of: System.out.println(10 + 20 + "Hello");
- 08
Which access modifier makes a member accessible only within its own class?
- 09
What is the correct way to create an array in Java?
- 10
Which method is used to compare two strings in Java?
- 11
What does the 'static' keyword mean in Java?
- 12
Which exception is thrown when dividing by zero in Java?
- 13
What is method overloading in Java?
- 14
Which package is automatically imported in every Java program?
- 15
What is the purpose of the 'final' keyword when applied to a variable?