Address.java - import java.io.Serializable Assignment 8...

This preview shows page 1 - 2 out of 2 pages.

import java.io.Serializable; // 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 implements Comparable, Serializable { // 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. ************************************************************************/ public String getState() { return state; } /************************************************************************ Modifier method:

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture