main方法必须被说明为public static void。
java语言区分大小写。
源文件的命名规则:
1.if there were multiple classes in a source file, only one class could be a public class.
2.if there was a public class,the file name must be the same with the name of public class.
3.the file extension is always 'java'.
4.if thee is no public file,the file name should just be the same with one of classes in the file.
if there were multiple classes in a file,file-compiling will create more than one byte file(字节码文件).the name of byte file will be the same as the class name.
statement 'package':
package [package name];
how to run:java [package name].[filename]
statement 'import': import [class name];
located between 'package' and class definition
Common pacages:
java.applet include all classes to achieve Java Applet.
java.awt include classes of graphic, text, window GUI in abstact window tool kit.
java.awt.image include classed of image in abstact window tool kit.
java.lang include all basic language classes.
java.io include all input & output classes.
java.net include all classes to achieve net function.
java.until inclede useful data type classes.
java.awt.peer include GUI tool kit throgh platform.
------------------
snigoal@Wang,HUST.Wuhan.China

没有评论:
发表评论