Thursday, 24 August 2017

Class in Java



“class”  In  Java:

So a “class” in java is a fundamental building block of a program or in simple words I can say that it is a name given to the program.
There may exist a question that “Why would one give a name to a program using “class” while the purpose of the program is to get execute and just run on a machine”. The above statement could be true in some cases; for example consider in C Language we will not mention any class name there, all we do is to write and run the code.
But remember that C is a structure-Oriented language and Java is a Object-Oriented Language. So, by naming the class in java you are able to implement the features of OOP like Abstraction, Encapsulation and Data hiding.

Consider a pic(almost) that shows the difference between c and java.



You will see how we use class names to implement these OOP principles mentioned above in further posts.



In next post we will deal the structure and general form of a class.
BYE! Keep visiting

No comments:

Post a Comment

             The `this` keyword in java The this keyword in java can be used for different purposes. Some of these are listed below. ...