4000336032
《Java基础知识总结》系列是对自己学习Java历程中知识的一个总结,也是为自己找工作前知识的回顾,为找工作奠定基础。
1、Identifiers:标识符
①Names of class,method and variable:用于类名、方法名、变量名
②Begin with character,"_" or "$":标识符不能以数字开头
③Case sensitive:大小写敏感(区分大小写)
④No length limitation:长度无限制
⑤标识符不能是Java关键字,汉字也可以做标识符,但是不建议使用(使用汉字涉及到编码问题,跨平台时回出现问题)。
⑥String是Java的一个类,类名是标识符,所以String可以做标识符。
⑦There is no sizeof operator.Java中没有sizeof运算符,所以sizeof可以作为标识符
⑧关键字、保留字(const、goto、true、false、null)不能用作标识符。
2、Keywords:关键字
The goto and const keyword are not used in the Java programming.
const 保留关键字(留儿不用)。const是从C++继承而来的,但是Java并不使用const这个关键字,由于JVM是由C++编写的,因此,虽然Java并不使用const这个关键字,但却要保留下来。和const一样goto也是保留关键字!
关键字全部用小写表示(53个)
Strictly speaking,the literals true,false,and null are not keywords but literals;however,the distinction is academic.
true,false,and null是保留字但不是关键字,只是3个值,不能用来做关键字。
3、Primitive data types:基本数据类型
Java强数据类型只能先声明后使用。
boolean Boolean literals indicating true or false
char Stores one 16-bit unicode character
char 同时具备字符和整数的特征。
byte 8-bit integer
short 16-bit integer
int 32-bit integer
long 64-bit integer
Integer Data Types-byte,short,int and long
float 32-bit floating-point number
double 64-bit floating-point number
在范围内的常数可以自动转换类型,但是变量就不一定了。
小————》大 自动转换
大————》小 强制类型转化
Byte相当于截取了较后8位,前面的全部舍去
更多优惠信息请咨询成都Java培训学校:http://cdjavapx.soxsok.com/
联系人:孙老师
联系电话:400-0088-291 在线qq:1974950309