A/An ______ is a user-defined datatype which has data members and member functions.
DSSSB TGT - 2023,
Answer: A
A class is a user-defined data type that holds data members and member functions. An object is an instance of a class, created from it, not the type itself. A package is a way of grouping related classes in languages such as Java, and a method is a single function inside a class. Only the class fits the definition. In Java and C++ the keyword class is used to define such a type, and objects are then created from it.
Please log in or register to report this question.