
what is meant by class?why we use class?what is the purpose of class?what is the main theme of class?tell clearly?plz...

Hello Friend,
A class is a blue print through which an object is created. In Java, all things are based on class and object.
class Person {
String name = "";
int age = 0;
void changeName(String name1) {
name = name1;
}
void changeAge(int age1) {
age = age1;
}
void print() {
System.out.println("Name:"+name+"\nAge:"+age);
}
}
class PersonInformation{
public static void main(String[]args){
Person p=new Person();
p.changeName("B");
p.changeAge(20);
p.print();
}
}
The design of this class is based on the person objects. The fields name and age represent the state of object, and the methods- changeName and changeAge define its interaction with the outside world.The Person class does not contain a main method as it is just the blueprint for persons that might be used in a program.The class PersonInformation takes the responsibility of creating and using person objects.
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.