. Java Cart . Java Cart Zip java
Java Cart Zip java
package cart;
//Zip - has methods to store and verify zip codes
//author - Lawrence Truett - FluffyCat.com
//date - August 12, 2003 - San Diego, CA
public class Zip {
private String rawZip = null;
private int zip5;
private int zipPlus;
private boolean isNumeric;
public Zip() {}
public Zip(String zipIn) {
this.setZip(zipIn);
}
//could probably have all sorts of cleaver verification stuff here
//could also populate appropriate zip5, zipPlus4, etc
//note USA zips are numeric, others are not
public String getZip() {return rawZip;}
private void setZip(String zipIn) {this.rawZip = zipIn;}
public String toString() {return ("zip: " + this.getZip());}
}
download source, use right-click and "Save Target As..." to save with a .java extension.
| Comments |
| Sign In |
| to add the first comment for Java Cart Zip java. |