Magazine - Returns this magazine as a string-public String...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Author: Lewis/Loftus // // Solution to Programming Project 12.2 // // Represents a single magazine. //******************************************************************** / public class Magazine implements Comparable { private String title; //----------------------------------------------------------------- // Sets up the new magazine with its title. //----------------------------------------------------------------- public Magazine (String newTitle) { title = newTitle;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } //-----------------------------------------------------------------// Returns this magazine as a string. //-----------------------------------------------------------------public String toString () { return title; } //-----------------------------------------------------------------// Implementation of the Comparable class method //-----------------------------------------------------------------public int compareTo(Object obj) { Magazine other = (Magazine)obj; return title.compareTo(other.title); } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online