一、关键字
黑色细体字:常用类名、常用方法名、局部变量名.
java中常用的关键字:
类相关:class、abstract、interface、extends、implements
package、import
访问权限相关:public、private、protected
方法相关:void、return
基本数据类型:int long short float double byte char boolean
循环判断相关:for switch if else break case continue default while do
异常相关:try、catch、finally 、 throw、hrows
其他的:instanceof this super final、synchronized、enum、static
二、数据类型基本数据类型:short int long float double byte char boolean
引用类型(又名:类类型)所有以类方式定义的类,全部都是引用类型
两者区别:
基本数据类型:没有方法和属性调用,只是用于存储基本变量值
引用类型,有方法和属性调用,执行复杂的操作
八大基本数据类型每个类型都会对应有一个引用类型
int -> Integer char -> charactor
另外6个只需要大写第一个字母
Short Long Float Double Byte Boolean
(intValue为Integer类的取整数方法)
Integer c = 20;
int h = c.intValue();
三、访问权限
权限有四种:
public protected 默认不写 private (范围由大到小 )
public:整个工程随意访问使用
Protected:只能在同一个包下类使用,不同包的子类可以继承它
默认不写:只能在同一个包下类使用
private:访问权限最小,只能在当前类自己内部使用