Computer Science
What do you mean by instantiating a class?
Objects & Classes
4 Likes
Answer
Instantiating a class means creating an object of the class. A class is instantiated with the help of new operator that allocates space in dynamic memory for the storage of an object.
Answered By
1 Like
Related Questions
What do you mean by Abstract class?
In what way is a class helpful in creating a user defined data type?
Design a class 'Time' with the following specifications:
class Time
Data members/Instance variables
int hour, min, secMember Methods:
void gettime( ) : to accept a time in hour, minute and second. void showtime( ) : to display the time in terms of hour, minute and second.Write a main method to create an object of class 'Time' and call the member methods.
Design a class 'Rectangle' with the following specifications:
class Rectangle
Data members/Instance variables
int length, breadth, area, perimeterMember methods:
void input( ) : to accept length and breadth of a rectangle.
void calculate( ) : to calculate area and perimeter of rectangle.
void display( ) : to print area and perimeter of rectangle.Write a main method to create an object of class 'Rectangle' and call the member methods.