JAVA的基本语法1
词法与句法2
数据类型(datatype)3
常量与变量(variable)4
运算符(operator)5
表达式(expression)6
语句(statement)关键词(Keyword)1
abstractdoubleintstrictfp**2
booleanelseinterfacesuper3
breakextendslongswitch4
bytefinalnativesynchronized5
casefinallynewthis6
catchfloatpackagethrow7
charforprivatethrows8
classgoto*protectedtransient9
const*ifpublictry10
continueimplementsreturnvoid11
defaultimportshortvolatile12
doinstanceofstaticwhile注:*当前未被使用**使用于Java2标识符(Identifier)标识常量、变量、数据类型、类和方法publicclassHelloWorld1{publicstaticvoidmain(String[]args){Stringmessage=“HelloWorld
”;myPrint(message);}privatestaticvoidmyPrint(Strings){System
println(s);}}标识符(Identifier)组成规则1
字母(A~Z、a~z)、特殊符号($、_)和数字(0~9)2
第1个符号不能为数字3
不能为关键词(keyword)、true、false、null4
区分大小写标识符(Identifier)例:point4、5w、A%、thisPicture、$currentValue、OK、_2