What is Class in Java?
Class
 are a blueprint or a set of instructions to build a specific type of object. It is a basic concept of Object-Oriented Programming, which revolve around the real-life entities. Class in Java determines how an object will behave and what the object will contain.

      Classes combine data and the methods (code) to manipulate the data

   Classes are a template used to create specific objects

   All Java programs consist of at least one class.

   Two types of classes

   Application/Applet classes

   Service classes

Why Use Classes?

   Usually, the data for a program is not simply one item.

   Often we need to manage entities like students, books, flights, etc.

    We need to be able to manipulate such entities as a unit.

  Classes allow us to separate the data for each object, while using
   common code to manipulate each object.

Syntax

class <class_name>{ 

    attributes

    method 

  } 

Where attributes and method are the member of the class

A simple class example
Suppose, Student is a class and student's name, roll number, age are its fields and info() is a method. Then class will look like below.
class Student.
{
 String name;
 int rollno;
 int age;
void info(){
 // some code
}
}
Object is an instance of a class while class is a blueprint of an object. An object represents the class and consists of properties and behavior."
An attribute is another term for a field. It's typically a public constant or a public variable that can be accessed directly. In this particular case, the array in Java is actually an object and you are accessing the public constant value that represents the length of the array.
A method is a block of code, which only runs when it is called. You can pass data, known as parameters, into a method. Methods are used to perform certain actions, and they are known as functions.