The best thing about classes is that we can write our own.
Classes are safe, and can easily associate methods with particular data items.
They can save on coding time and quantity and produce neater code in general. A user-defined class can either be attached to a .java file, outside of the main class definition, or it can be written in it's own .java file, in which case, once compiled many programs can use it through the import statement. If the class is public, it must be in a .java file of the same name. Circle Class Let us create the Circle class. This class create different sized and colored circles.