At minimum, the class declaration must contain the class keyword and the name of the class that you are defining. Thus the simplest class declaration that you can write looks like this: class NameOfClass { . . . } For example, this code snippet declares a new class named ImaginaryNumber.
Read moreHow do you create and declare a class in Java?
To create an object of Main , specify the class name, followed by the object name, and use the keyword new :
Read more