? code (.java file): Java编译器对源代码进行词法分析和类型校验,生成字节码文件(.class file): Java解释器执行字节码文件中的类,Java解释器在加载和执行类时验证类的完整性、正确操作和安全性,并与所在的操作系统、 double int strictfp ** else interface super extends long switch final native synchronized finally new this float package throw for private throws goto * protected transient * if public try ?continue implements return void ?default import short volatile ?do instanceof static while 注: *?当前未被使用**?使用于Java25标识符?标识?常量、变量、数据类型、类和方法public class HelloWorld1 {public static void main(String[] args) {String message = “Hello World!”; myPrint(message);}private static void myPrint(String s) {(s);}}6标识符?(A~Z、a~z)、特殊符号($、_)和数字(0~9)、true、false、null?区分大小写7标识符?例:point4、5w、A%、thisPicture、$currentValue、OK、_23b、Y_123、#length、a+b、if?5w、A%、#length、a+b、if8标识符?,,,后面的描述性词以大写开始,如getCurrentValue?表示私有或局部变量的标识符全部用小写字母,如next_value9分隔符?空白符?空格、换行符、制表符?分号?表示语句结束,或用于for循环语句中?逗号?变量之间的分隔?冒号?? : (三目运算符) /switch循环中的case语句?花括号?类体、方法体、复合语句(for/while/switch/if)
Java语法基础知识课件 来自淘豆网m.daumloan.com转载请标明出处.