NameAndZip - public String getFName () { return firstName; }

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

View Full Document Right Arrow Icon
//****************************************************************************** // NameAndZip.java Author: Lewis/Loftus // // Represents an address book entry used to store names and zip codes. //****************************************************************************** / import java.text.*; i public class NameAndZip { private String firstName = ""; private String lastName = ""; private int zipCode; private static DecimalFormat form = new DecimalFormat("00000"); //--------------------------------------------------------------------------- // Sets up the adress book entry by entering the first and last // name and the zip code //--------------------------------------------------------------------------- public NameAndZip (String fName, String lName, int zCode) { firstName = fName; lastName = lName; zipCode = zCode; } //--------------------------------------------------------------------------- // Returns the string value of firstName //---------------------------------------------------------------------------
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public String getFName () { return firstName; } //---------------------------------------------------------------------------// Returns the string value of lastName //---------------------------------------------------------------------------public String getLName () { return lastName; } //---------------------------------------------------------------------------// Returns the int value of zipCode //---------------------------------------------------------------------------public int getZCode () { return zipCode; } //---------------------------------------------------------------------------// Returns the address book entry in a one line format //---------------------------------------------------------------------------public String toString () { return firstName + " " + lastName + "\t" + form.format(zipCode); } }...
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