answersLogoWhite

0

I think what you know is called constructor.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What conditions a function must specify in order to create objects of a class?

The object must have same name as that of class name.


What condition a function must specify in order to create objects of a class?

The object must have same name as that of class name.


What is meant by instancing a class?

The class can be considered a template to create objects. When you create an object, you create it on the basis of the specified class - the object is an instance of the class, and the act of creating the object is also known as "instantiating" the class.


How do you create object name for child class in c?

child a=new child();


What is the eligibility for an object to get cloned?

the most obvious thing to eligible for object is to create his class and define it as opening for the class name and sow for it in last for the code


How do you create the object?

ClassName instName = new ClassName(); where class name is the class, instName is the variable for the instantiated class, and ClassName() is the constructor.


What are object and how object created?

Every thing is object. An object is formed by one or more object. even variable and function are object in java. how to create object: class book{ String name; } now if we want to create an object of book type then book mybook = new book();


What is difference between classes and objects?

Posted by : Govind Singh Lodhithese are the following differences between java class and object.1. Class is a way of bind data member and method in single unit where as a object is a value form of a class or a instance of a class that means allocating sufficient amount of memory space.2. When we define a class ,there is no memory space allocated for data member of a class where as when we create a object of a class memory space is allocated for data members of a class.3.Class will have exist logically where as object will have exist physically.4.One class can have only one name where as corresponding one class we can create multiple object.5.Class load in main memory by using class loader subsystem where as after load class we can create multiple objects of a class.


How constructor automatically invoked?

when we create the object of that class


What is object program?

friend, I'll explain an object in the context of class in CPP programming. after the definition of a class , you can define an object belonging to that class. for example, class student { int rollno; char name[10]; void getdetails() {cout<<"enter the roll number and name of the student"; cin>>rollno; gets(name); } void showdata() {cout<<"the name is"<<name<<"and the rollnumber is" <<rollno; }} sara; here sara is an object belonging to class student. object sara can use the function getdetails() to get values to the identifiers rollno and name. " Class is a group of objects with similar characters ( eg: rollno , name) and behaviour ( ie., the member functions-getdetails and showdata)" " An object is a an entity with certain characters and behaviour" here object sara denotes a student sara. now, you can create another object rahul to the class student by typing the code- student rahul;


What do you mean by Get instance?

It means create an object for a class. Instance refers to the obj of a class.


Write a program to create object without name?

You cannot create an object without a name. The name identifies the object. If you really mean anonymous classes, then the following is an example of an anonymous class (a class with no identifier):typedef struct {unsigned x;unsigned y;} POINT;There are some restrictions with regards anonymous classes:They can have no constructors or destructor.They cannot be returned from functions.They cannot be passed as type-checked arguments to functions.