请问System.out.println()的真正含义是什么?(50分!)
刚学java不久,看了一些初级的教材,不明白System.out.println()的细目是怎样的,.out是System类下的一个static final 变量,变量下面为什么会有方法呢?
还有这个程序,是新东方教材中的一个,功能是在程序编译执行后,可以显示在控制台录入的字符。
但是每次都报找不到main的错误:
import java.io.*;
public class KeyboardInput{
public static void main(String[] args)
{
String s;
InputStreamReader ir = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(ir);
System.out.println("Unix: Type ctrl-d or ctrl-c to exit." +
"\nWindows:type ctrl-z or ctrl-c to exit.");
try
{
while((s = in.readLine()) != null)
{
System.out.println("Read: " + s);
}
in.close();
}catch(IOException e)
{
e.printStackTrace();
}
}
}