KnowledgeBoat Logo
|

Computer Applications

What are the points to be taken care while naming a class in a Java program?

Java Intro

101 Likes

Answer

A class name should be a valid Java identifier i.e. it should follow the below three rules:

  1. Name of the class should be a sequence of alphabets, digits, underscore and dollar sign characters only.
  2. It should not start with a digit.
  3. It should not be a keyword or a boolean or null literal.

Answered By

66 Likes


Related Questions