Learn JAVA MCQs
Prepare JAVA MCQs (Multiple choice Questions) for exam and job interviews.
Which of the following is used to create a constant in Java?
1) final
2) static
3) const
4) None of the above
Answer : final
What is the output of System.out.println(10 == 20);?
1) true
2) false
3) Error
4) None of the above
Answer : false
Which of the following is used to access a static variable in Java?
1) Class name
2) Object
3) Both 1 and 2
4) None of the above
Answer : Class name