DEV Community

Naga Arjun
Naga Arjun

Posted on

Class in Java ::

Class :

  • A class is a blueprint used to create objects that share common properties and behavior.
  • An object is an instance of a class. It represents a specific entity created from the class template.

Create a Class :

  • A class in Java is created using the class keyword.
  • It is used to define the properties (variables) and behaviors (methods) of objects.
public class Main {
  int x = 5;
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)