Home
MCQs
Java MCQs
Naming conventions
Java MCQs

Java MCQs - Naming conventions

Naming conventions MCQs contains rules for writing naming styles for Fields, Methods, Classes, Interfaces, Packages and Constants

11. Which is the right naming convention for Interface in Java?

A. interface Printable_Page

B. interface Printable

C. interface printable

D. All of above

Answer: B

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

A. void DrawShape()

B. void draw_shape()

C. void drawShape()

D. All of above

Answer: C

13. 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

14. Which is the right naming convention for package in Java?

A. package com.sindhi.tutorials;

B. package comSindhiTutorials;

C. package ComSindhiTutorials;

D. All of above

Answer: A

15. Which is the right naming convention for Constants in Java?

A. static final int day_package

B. static final int DAY_PACKAGE

C. static final int dayPackage

D. All of above

Answer: B

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

A. Yes

B. No

Answer: A