Class & Object in JAVA
To learn java programs https://wordpress-343193-1101484.cloudwaysapps.com/interface-program
A class is a blueprint/ template for an object. A class contains data members and member methods.
An object is a unique entity that has state and behavior. An object is called an instance of the class.
To learn java programs
Interface program
Data members show the characteristic /properties /physical feature of an object.The member methods display(represent) the behavior of an object. From one class many objects of the same type can be created that is why a class is called an object factory.
All the objects of the class will have state and behavior. The data member represents the state and the member methods represent the behavior of an object of a particular class.
For example in a class student, age and student name, father name can be data member and payfees() and study() can be the member methods.
From the given class any number of objects can be created. All the objects of this class will have the same state(physical features) and behavior (functionality)
The values of all the states will be different for each object. The values given to the state is called an attribute.
A real-life example of a class and an object can be a map of a house and a real house.
The map of the house gives a blueprint of the house that will be constructed using the map of the house, the house is an object of the class-map, the object is an instance of a class map.
Here class map is something that is not a real thing, it is something abstract that cant be used in real life, but when an object is created from a class, it can be used in real life.
The syntax of a java class is as follows.
class Student
{
int age;
String stud_name;
String father_name;
void payfees()
{
}
void study()
{
}
}The syntax to create objects from the following class is as follows.
Student Pratikraj=new Student();
Student Anay= new Student();Both these objects will have data members that are mentioned in the class like age, stud_name, and father_name.
The values can be assigned to these data members in the following way.
Pratikraj.age=17;
Pratikraj.stud_name="Pratikraj";
Anay.age=17;
Anay.stud_name=" Anay";
The functions of this class can be called by the given syntax
Pratikraj.payfees();
Anay.study();For videos related to java programming
http://www.youtube.com/user/trushnatej
Related Posts
Continue learning with these related articles

ISC Practical 2027: College Enrolment Code Validator and Stream Report – Algorithm and Java Program
Fully solved ISC Computer Science Practical 2027 question: validate college enrolment codes made of a stream, year and serial number, give the exact reason for each rejection, auto-correct lowercase streams and prepare a stream-wise report.

ISC Practical 2027: Digital Lock Security Code Analyzer – Algorithm and Java Program
Fully solved ISC Computer Science Practical 2027 number-logic question: for a 5 to 10 digit security code, find the first and last digits, odd and even position sums, product of non-zero digits, digit frequency and classify the code as STRONG, MODERATE or WEAK.

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.