Topic: 高手帮忙(编译不成功 找不到符号)

  Print this page

1.高手帮忙(编译不成功 找不到符号) Copy to clipboard
Posted by: kobebrint
Posted on: 2007-04-04 22:23

import java.io.*;
public class ww{

public static void main(String args[])
{

System.out.println("shu ru yi zhu zi");
try
{
String AA=(string)System.in.read();
System.out.println(""+AA);

}catch(Exception e){
e.printStackTrace();

}
}
}

为什么编译不成功啊 说找不到符号

2.Re:高手帮忙 [Re: kobebrint] Copy to clipboard
Posted by: xuxiaolei
Posted on: 2007-04-05 07:56

public static void main( String args[] ) throws IOException
{
   InputStreamReader reader = new InputStreamReader(System.in);
   BufferedReader buffer = new BufferedReader(reader);
   String line = buffer.readLine();
   System.out.println(line);
}

这样的例子书上都有,多看看书

3.Re:高手帮忙(编译不成功 找不到符号) [Re: kobebrint] Copy to clipboard
Posted by: xiezhuojun2006
Posted on: 2007-04-06 21:26

你的路径没有设定好
要不在main(String args[])后加:throws java.io.IOException


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923