DEV Community

Chithra Priya
Chithra Priya

Posted on

Class in java

Class:

A class is a group of objects which have common properties. It is a blueprint or template from which object is created. It is logical entity. Class is a user defined blueprint or prototype from which objects are created.
In java class contains:

  • Fields
  • Methods
  • Constructor
  • Blocks
  • Nested class
  • Interface

Syntax to declare a class:

class class_name
{
field;
method;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)