public class HelloWorld{
public static void main(String[]args){
System.out.println("HelloWorld");
}
}
类名要和源文件的名字一样
需要成对编程,并且代码中的符号都需要是英文的
main方法的固定格式
public static void main(String[]args){
}
源文件中可以有多个类,但是只能有一个被public修饰的类,并且文件名和public修饰的一样。