There are three major components of class in Java.
1) VariableVariable is a reserved memory location to hold a value. In other words, when we want to store any value and give it a name, that value takes a reserved space in memory and it’s called as a variable.
2) ConstructorA constructor is like a special method in Java, which is used to initialize an object of a Java class and Constructor is very important for every Java class and if we don’t declare the constructor, the compiler creates a default constructor of a Java class.
A constructor must be the same name of a Java class. It does not have a return type.
3) MethodA 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 also known as functions.
For a detailed tutorial on Java classes Components, Visithttps://www.c-sharpcorner.com/article/a-complete-java-classes-tutorial/