As it is discussed during our Java introduction, Java is considered to be OOP – Object Oriented Programming which represent everything as Class and Object with the Attribute and Methods. Therefore Class is considered to be Object Constructor /Blue Print for creating Object.
There are different kind of Class in a Program that represent different Objects. The classification of the class mainly categorized as
- Built In
- User Defined Class
Built-In Class
These are classes mainly introduced along with the Java Programming Language. This means all the Language resources are represented with Class and In order to user the resource of the language , it is necessary to create an Object. This will save our time of developing new solution, and debugging as well. Let us consider a scenario,
Example – Find out Number of Character In a Person Name
Figure 1. 1 Using A Built-In String Class to Create an Object
User Defined Class
This is a class defined by the user to address a specific need of an object. As we mentioned earlier, OOP helps us to represent any real world object in Class. Then possible to create an object from that class to make all the possible operations. Let us consider the same Example stated above and make a solution using our User Defined Class.
Figure 1. 2 Using A User Defined Class to Create an Object