Java Reference
In-Depth Information
LISTING 13.3
//********************************************************************
// Magazine.java Author: Lewis/Loftus
//
// Represents a single magazine.
//********************************************************************
public class Magazine
{
private String title;
//-----------------------------------------------------------------
// Sets up the new magazine with its title.
//-----------------------------------------------------------------
public Magazine (String newTitle)
{
title = newTitle;
}
//-----------------------------------------------------------------
// Returns this magazine as a string.
//-----------------------------------------------------------------
public String toString ()
{
return title;
}
}
info
info
info
info
list
next
next
next
next
info
newNode
next
FIGURE 13.2 Inserting a node into the middle of a list
Search WWH ::




Custom Search