Home
MCQs
Java MCQs
All MCQs
Java MCQs

Java MCQs - All MCQs

History, JVM, JRE and JDK, Variables, Data Types, Operators, Control Statements, Iterative Statements, Object Class, Naming conventions, Constructors

11. What is the correct output of this program ?

A. 10987654321

B. 987654321

C. 123456789

D. 12345678910

Answer: A

12. Which is the right naming convention for Variable in Java?

A. double GrossSalary;

B. double grossSalary;

C. double gross_salary;

D. All of above

Answer: B

13. What the naming convention should be for Interfaces in Java?

A. It should start with the uppercase letter.

B. It should be an adjective such as Intelligent, Acceptable

C. Use appropriate words, instead of acronyms.

D. All of above

Answer: D

14. A name of variable is known as

A. Data Type

B. Constant

C. Identifier

Answer: C

15. Do we follow camel-case syntax for naming the class, interface, method, and variable?

A. Yes

B. No

Answer: A

16. Java ME stands for ?

A. Java Enterprise Edition

B. Java Standard Edition

C. Java Micro Edition

D. None of Above

Answer: C

17. Which are the arithmetic operators ?

A. * / %

B. + -

C. All of above

Answer: C

18. Which are the relational operators ?

A. < <=

B. > >= instanceof

C. == !=

D. All of Above

Answer: D

19. What is the correct output of this program ?

A. A2 A2 A3 Default

B. A2

C. A2 A3 Default

D. Default

Answer: C

20. Which kind of Java programming is?

A. Procedural

B. Non-Procedural

C. Object Oriented

D. Event Driven

Answer: C