Object and classes can be considered as the building blocks of the Java programming language. Just like the real world, larger objects are made up of different kind of smaller objects. Not only this, the objects can be combined with other objects too, which is a general characteristic of the object-oriented programming language.
Not only this, object-oriented programming language provides many different features such as classes and objects. These features make the programming language not only easy to use but also very flexible.
A class can be defined as a template for large number of objects having similar features. A particular set of objects having similar features can be embodied in a class. In an object-oriented programming language a programmer defines class of objects instead of actual classes.
For example, a Tree class can define the common characteristics of all the trees, such as their roots, stems, leaves; they grow, give oxygen and take in CO2 and so on. This Tree class serves as an abstract instance of a Tree. Not only this, the Tree class can be used to create different instances of a Tree such as small bushy Tree, new leaves growing in the Sp[ring season, and so on. However all these classes not only originate from the original Tree class but also have the characteristics of the original Tree class.
Continue reading JAVA – Classes and Objects