关键字2-2异常处理trycatchfinally·字面值常量throw-falsethrows-true- null对象相关关键字·方法相关关键字new-returnextends- voidimplementsclass·包相关关键字instanceof-packagethis-importsuper6浙江科技学院
6 关键字2-2 • 异常处理 - try - catch - finally - throw - throws • 对象相关关键字 - new - extends - implements - class - instanceof - this - super • 字面值常量 - false - true - null • 方法相关关键字 - return - void • 包相关关键字 - package - import
基本数据类型·Java共有八种基本数据类型:-四种整数类型(byte、short、int、long):两种浮点数类型(float、double)-一种字符类型(char)-一种布尔类型(boolean)7浙江科技学院
7 基本数据类型 • Java 共有八种基本数据类型: - 四种整数类型(byte、short、int、long) - 两种浮点数类型(float、double) - 一种字符类型(char) - 一种布尔类型(boolean)
整型数据类型类型长度缺省值数的范围08位byte-128 ~ 127016位short-32,768~32,767032位int-2,147,483,648~2,147,483,647064位long9,223,372,036,854,775,808~9,223,372,036,854,775,8078浙江科技学院
8 整型数据类型 类型 缺省值 长度 数的范围 byte 0 8位 -128 ~ 127 short 0 16位 -32,768 ~ 32,767 int 0 32位 -2,147,483,648 ~ 2,147,483,647 long 0 64位 -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807