DEV Community

Divya bharathi G
Divya bharathi G

Posted on

Class in Java

Class:
->A class is a blueprint or template used to create objects.
->Class is a Java keyword.
->A class does not occupy memory until an object is created.

Syntax for class:

class Classname
{

}
Enter fullscreen mode Exit fullscreen mode

Rules for Classname:
->The first letter of Classname should be in capital.
->Classname should allow special characters like $ and _ .
-> $ and _ can be used at the beginning, middle, or end of a class name, but no other special characters are allowed.
->Classname should allow numeric values that can be used in the middle or at the end of a class name.

Top comments (0)