The Artima Developer Community
Sponsored Link

Java Answers Forum
help

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Salma

Posts: 1
Nickname: saaa
Registered: Sep, 2002

help Posted: Sep 20, 2002 6:46 AM
Reply to this message Reply
Advertisement
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.");
}

}

}
}

Topic: java plugins Previous Topic   Next Topic Topic: Do I need to purchase a signed applet

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use