Novel - // Returns the cast of characters for this novel.

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

View Full Document Right Arrow Icon
//******************************************************************** // Novel.java Authors: Lewis and Loftus // // Solution to Programming Project 7.3 //******************************************************************** public class Novel extends Book { protected String[] characters; //----------------------------------------------------------------- // Sets up this novel with the specified information. //----------------------------------------------------------------- public Novel (String thisTitle, String isbnNum, String auth, String[] chars) { super (thisTitle, isbnNum, auth); characters = chars; } //----------------------------------------------------------------- // Sets the cast of characters for this novel. //----------------------------------------------------------------- public void setCharacters (String[] chars) { characters = chars; } //-----------------------------------------------------------------
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 the cast of characters for this novel. //-----------------------------------------------------------------public String getCharacters() { return characters; } //-----------------------------------------------------------------// Returns a description of this novel as a string. //-----------------------------------------------------------------public String toString() { String result = super.toString(); for (int index = 0; index < characters.length; index++) result += "\n" + characters[index]; return result; } //-----------------------------------------------------------------// Prints a message appropriate for this novel. //-----------------------------------------------------------------public void content() { super.content(); for (int index = 0; index < characters.length; index++) System.out.println (characters[index]); } }...
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