Initial Commit P2 Part 1
This commit is contained in:
36
Semester 2/Programming 2/Project/Part 1/Library.java
Normal file
36
Semester 2/Programming 2/Project/Part 1/Library.java
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
/**
|
||||
* Write a description of class Library here.
|
||||
*
|
||||
* @author (your name)
|
||||
* @version (a version number or a date)
|
||||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Library
|
||||
{
|
||||
private ArrayList<LibraryItem> itemList;
|
||||
|
||||
/**
|
||||
* Constructor for objects of class Library
|
||||
*/
|
||||
public Library()
|
||||
{
|
||||
itemList = new ArrayList<LibraryItem>();
|
||||
}
|
||||
|
||||
public void storeItem( LibraryItem item )
|
||||
{
|
||||
itemList.add( item );
|
||||
}
|
||||
|
||||
public void printAllItems()
|
||||
{
|
||||
for( LibraryItem item : itemList )
|
||||
{
|
||||
item.printDetails();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user