1.

If a database have to be maintained using OOP, to store the details of each employee in a company, which would be the best choice among the following?(a) Define a class to store details of each employee(b) Define a structure to store details of each employee(c) Define separate variable for each detail(d) Define a generic type to store string and number detailsI have been asked this question in class test.The above asked question is from Class Use in chapter Classes of Object Oriented Programming

Answer»

Right choice is (a) Define a class to store details of each employee

Easy explanation - A single class can be defined that REPRESENTS a single employee of a company. The SPECIFIC type of FUNCTIONS that can be applied to specific employees can be put into ANOTHER class that is derived from the EXISTING class.



Discussion

No Comment Found

Related InterviewSolutions