Address

Address - public String getState() { return state; }

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// Assignment #: 8 // Name: your name // StudentID: your id // Lecture: your lecture number // Description:The Address class describes city and state of a bank. // It will be used as an aggregate object of the Bank class. It has following attributes: public class Address { // instance variables private String city; private String state; /************************************************************************ Constructor method to initialize intance variables. ************************************************************************/ public Address() { city = new String("?"); state= new String("?"); } /************************************************************************ Accessor method: This method returns the city of the address. ************************************************************************/ public String getCity() { return city; } /************************************************************************ Accessor method: This method returns the state of the address. ************************************************************************/
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public String getState() { return state; } /************************************************************************ Modifier method: This method sets the city of the address given by its parameter. ************************************************************************/ public void setCity(String city) { this.city = city; } /************************************************************************ Modifier method: This method sets the state of the address by its parameter. ************************************************************************/ public void setState(String state) { this.state = state; } /************************************************************************ This method return a string containing the attribute information in address ************************************************************************/ public String toString() { String result; result = city + "," + state; return result; } }...
View Full Document

This note was uploaded on 11/09/2010 for the course CSE 205 taught by Professor Matasu during the Spring '08 term at ASU.

Page1 / 2

Address - public String getState() { return state; }

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online