When we start talking about Object oriented programming, first things comes in our mind is Class an Object and than questions like What is Class in Java , What is Object in Java and how to use these. those who are from C programming background doesn’t familiar with Class and Object and they can relate it to structure in C with difference that Strcutre in C doesn’t contain any method while Class in Java does. Class and Object are two pillars of Java programming which is almost 100 percent Object oriented programming language. Class in Java is a blueprint which is used to create object , also called as instance in Java. Class is a user defined type much similar with structure in C with different that Class can contain both variables and functions while structure can only contain variables. variables and functions are called members of Class in Java and they are refereed as field and methods in Java.
This article explains what is Class in Java, what are elements of Class and how to write Class in Java.