I Have question Write a class that represent a person's mailing address. It should have separate field for the name, street address, city, state and ZIpcode. Please design and implement your program so that the test addresses are entered interactively by the user and blank fields are not allowed.
I have a problem for terminating for command here is what I did. please check and correct any errors for my program.
import java.io.*; //import java.lang.*; public class Aaa { public static void main(String[] args ) throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Please enter your name:"); String line = in.readLine(); System.out.print("Please enter your Street Address:"); String Address = in.readLine(); System.out.print("Please enter your City:"); String City = in.readLine(); System.out.print("Please enter your State:"); String State = in.readLine(); System.out.print("Please enter your Zipcode:"); String Zipcode = in.readLine(); for(;;) {
//String line = in.readLine(); if ((line == null) || line.equals("quit")) //break;
try { } catch(Exception e) { System.out.println("Thanks for the infor."); }