0

What is class in java...?

I'm new to the programming languages.

23rd Jun 2017, 2:46 AM
Dhananjay Mudgule
Dhananjay Mudgule - avatar
1 Answer
+ 1
A class is nothing but a blueprint or a template for creating different objects which defines its properties and behaviors. Java class objects exhibit the properties and behaviors defined by its class. A class can contain fields and methods to describe the behavior of an object. Methods are nothing but members of a class that provide a service for an object or perform some business logic. Java fields and member functions names are case sensitive. Current states of a class’s corresponding object are stored in the object’s instance variables. Methods define the operations that can be performed in java programming. Example: public class Cube { int length; int breadth; int height; public int getVolume() { return (length * breadth * height); } }
23rd Jun 2017, 2:48 AM
AJ Carlos
AJ Carlos - avatar