As part of a system for aiding student library research, a program is being deve
ID: 3716473 • Letter: A
Question
As part of a system for aiding student library research, a program is being developed to maintain a bibliography as a student prepares a term paper. You are designing a "Bibliography" class. In essence, a "Bibliography" is a container of "References" (books,papers, etc.) Assume that someone else has the responsibility of designing the "Reference" class. The most essential operations on a Bibliography are to add Reference objects identified by a title (a string), to fetch a Reference previously associated with a title, and to access all references in the bibliography. A junior programmer has proposed the following interface for this class. public class Bibliography Bibliographyo void put (String title, Reference h) .. Reference get (String title) // a data structure will be chosen later Modify this proposal to bring it in line with appropriate Java style for robust and re-usable ADTs.Explanation / Answer
public class Bibliography<T>//so..that it will work for different objects providing better reusability
{
//constructor
Bibliography();
void put(String title,T h);
public T get(String title);
};
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.