Computer Science
Answer
We may need to use a group of primitive types so that a number of values can be operated simultaneously by using a single interface. To do so, user may define a class with a specific name that serves as a specific data type. This is the reason, a class is referred to as user defined data type.
Related Questions
An object is referred as an instance of a class. Explain.
What do you mean by Abstract class?
What do you mean by instantiating a class?
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.