Basic knowledge about class and object in Java

0

We already discussed about java tools installation process in computer. Now we will try to get basic knowledge about class and object in Java. Now you may have  few question in your mind,

What is Class?

Class is a user defined Data type, which is mainly acts as like built in data types. Class includes many of the same type of objects. If we consider “Fruits” as class then apple, coconut, banana, mango, jack-fruit etc is an object of it.

There may have multiple and different classes in any program.

What is object?

Generally object mean any particular things, such as Man, Book, Pencil, Pen etc. There each an object. There are some special features or principles in object-oriented programming.

These are,

inheritance, Encapsulation, polymorphism, Static Binding, Data Hiding, Dynamic Binding, Message Passing

In this part we will not discuss about these features, because the head may hang.

 

 Here is an example of class,

 

Here is an example to create object,

Now If you compile that program to run then the output will be,

 

Share.

About Author

I have no more personal information to share with you but have enough experience to share with all. I am always funny