A class is a template used to create objects. Classes are made up of members, the main two of which are fields and methods. Fields are variables that hold the state of the object, whereas methods define what the object can do—the so-called behaviors of the object:
Object creation
To access a non-static class field or method from outside the defining class, an object of the class must first be created. That’s done using the new keyword, which will create a new object in the system’s memory: