Skip to content

Beginner level java quiz

What is the correct syntax for the main method in Java?

Which of the following is not a valid data type in Java?

What is the output of the following code? System.out.println(10 + 20 + "Java");

Which keyword is used to define a constant in Java?

What will be the output of the following code? int x = 5; int y = 10; System.out.println(x == y);

What is the default value of a boolean variable in Java?

Which of these is used to create an instance of a class in Java?

What does the break statement do in a loop?

Which of the following is true about Java arrays?

What is the purpose of the public keyword in Java?


J2J Institute private limited