1 public class MyFirstJavaProgram{ 2 public static void main(String[] args ){ 3 System.out.println("Hello World"); 4 } 5 6 }
大小写敏感(case sensitive)——Hello和hello在java中有着不同的意义
所有类名的首字母需为大写(upper case)
所有方法名首字母为小写(lower case)
文件名一般同类名 MyFirstJavaProgram.java
public static void main(String args[]) —— 程序的入口
java标识符(java identifiers)
All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore (_).
After the first character identifiers can have any combination of characters.
A key word cannot be used as an identifier.
Most importantly identifiers are case sensitive.
Examples of legal identifiers: age, $salary, _value, __1_value 正确例子
原文:http://www.cnblogs.com/linuxroot/p/3558311.html