static
静态内部类,静态方法,静态变量,静态导包
default
在switch语句中,表明一个默认的分支,java 8以后在接口中也可以使用修饰方法,提供默认的接口方法
public interface TV {
default void play(){
System.out.println("TV play");
}
}
native
native关键字可以应用于方法,以指示该方法是用Java以外的语言实现的
Class类中的部分例子
/**
* Determines if the specified {@code Class} object represents an
* interface type.
*
* @return {@code true} if this object represents an interface;
* {@code false} otherwise.
*/
public native boolean isInterface();
super
调用父类
synchronized
synchronized关键字可以应用于方法或语句块,并为一次只应由一个线程执行的关键代码段提供保护。
volatile
volatile关键字用于表示可以被多个线程异步修改的成员变量。
strictfp
用来声明FP_strict(单精度或双精度浮点数)表达式遵循IEEE 754算术规范
transient
1、一旦变量被transient修饰,变量将不再是对象持久化的一部分,该变量内容在序列化后无法获得访问。
2、transient关键字只能修饰变量,而不能修饰方法和类。注意,本地变量是不能被transient关键字修饰的。变量如果是用户自定义类变量,则该类需要实现Serializable接口。
3、被transient关键字修饰的变量不再能被序列化,一个静态变量不管是否被transient修饰,均不能被序列化。