Suppose you were told to implement a class whose objects


Question: Suppose you were told to implement a class whose objects need to store 10-20 pieces of data and the data is of several kinds. Some people might argue that you should store each piece of data in a separate instance variable in your object. Others might argue that it is ludicrous to have one instance variable for each piece of data, and so it would be better to store the data all in one instance variable, such as an array data of type Object []. For example, a Person object could store the person's first name in location data [0], the last name in data [1], the address in data [2], the age in data [3], etc. Give your opinion on these two approaches. Discuss the approach you would use.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Suppose you were told to implement a class whose objects
Reference No:- TGS02580184

Expected delivery within 24 Hours