import javax.swing.*;
class InputTest{
public static void main( String[] args){
String name = JOptionPane.showInputDialog("What is your name?");
String input JOptionPane.showInputDialog("how old are you?");
int age =Integer.parseInt(input);
System.out.println("hello,"+ name+".next year,you'll be"+(age+1));
System.exit(0);}}
还有这个
import java.io.*;
class tinyEdit{
public static void main(String[] args)throws IOEzception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str[]=new String[100];
System.out.println("Enter lines of test.");
System.out.println("Enter "stop" to quit");
for(int i=0;i<100;i++){
str[i]=br.readLine();
if(str[i].equals("stop")) break;
}
System.out.println("disp");
for (int i=0; i<100; i++){
if(str[i].equals("stop")) break;
System.out.println(str[i]);}}}
我是菜鸟不对的地方难免
[此贴子已经被作者于2006-8-8 22:29:00编辑过]