outpublic static final PrintStream outThe "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user. For simple stand-alone Java applications, a typical way to write a line of output data is: System.out.println(data)
out是System下的一个final static应该是这样定义的,你可以查一下jdk的帮忙 final static PrintStream out;
jdk 上的解释 out public static final PrintStream out The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user. For simple stand-alone Java applications, a typical way to write a line of output data is: System.out.println(data)
See the println methods in class PrintStream. See Also: PrintStream.println(), PrintStream.println(boolean), PrintStream.println(char), PrintStream.println(char[]), PrintStream.println(double), PrintStream.println(float), PrintStream.println(int), PrintStream.println(long), PrintStream.println(java.lang.Object), PrintStream.println(java.lang.String)
java是面向对象的,其实它实现的过程有点像c中的结构和联合。 变成思路要先定义类,类中包含了方法和变量。而你问的main()方法是用来将代码连接到解释器的方法,所有的引用和实现都要在main()中完成,也可以把他称作主方法,每一个程序可以有若干个类以及非main的方法,而main方法只能有一个。 还不明白的话去看看think in java或者张孝祥的java就业培训教程。
我想它可能是面向对象,而不象其他结构化的编程语言把~
“我看了许多JAVA的程序里面好多都没有MAIN()方法”,这是因为你看的是小应用程序,就是Applet程序,而Application程序都有main()
System.out是一个标准的输出流,和其它的OutputStream差不多,只不过它的输出目的地是控制台!
首先说一下楼上几位说得不是很对,System.out是一个标准的输出流,和其它的OutputStream差不多,只不过它的输出目的地控制台!前两句是对的,至于第三句错了一半,out是PrintStream类型的,应该说持类型的数据和DataOutputStream类差不多,是用来格式化数据用的,他也可以作为装饰器类来对硬盘等其他设备的格式化输出,不紧紧用于标准输出
final static PrintStream out;
out
public static final PrintStream out
The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user.
For simple stand-alone Java applications, a typical way to write a line of output data is: System.out.println(data)
See the println methods in class PrintStream.
See Also:
PrintStream.println(), PrintStream.println(boolean), PrintStream.println(char), PrintStream.println(char[]), PrintStream.println(double), PrintStream.println(float), PrintStream.println(int), PrintStream.println(long), PrintStream.println(java.lang.Object), PrintStream.println(java.lang.String)
我认为做java就应该刨根问底钻牛角尖,不要放过一个知识点,这样对以后的设计很有帮助。
而不象c里面 每个程序都要由main()方法
变成思路要先定义类,类中包含了方法和变量。而你问的main()方法是用来将代码连接到解释器的方法,所有的引用和实现都要在main()中完成,也可以把他称作主方法,每一个程序可以有若干个类以及非main的方法,而main方法只能有一个。
还不明白的话去看看think in java或者张孝祥的java就业培训教程。