Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com
Ques:-1 What
is the Class?
Ans:- Class
is the way to realize real time entity in oops. It is the user defined data
type.
Syntax of
Class
public class
Class_Name
Note: public
is an access modifier which can be anything like public,private etc.
Ques:-2 What
is the Object?
Ans:-Object
is the Runtime Entity of the Class.
Syntax of
object Creation
Class_Name object_Name=new Class_Name()
Ques:3 What
is Constructor?
Ans:-Constructor
is the method inside the class which is used to initialize or give default
value to the class member variable. It is invoked when we create new instance
of the class.
Features
of Constructor
It has same
name as the name of the class
It is called
automatically when the instance of the class created.
It doesn’t have
any return type not even void
Syntax of
Constructor