java关键字

1. static 1.static只能修饰 变量 和方法,表示该变量和方法属于类而不是实例。 2.被static修饰的成员,建议只能由类去访问。 3.static静态代码块内部 不能使用 this关键字,this是对实例的引用,static 方法禁用this关键字引用静态变量,要么不用,要么用类.静态变量。 4.static属于类,在类加载时,static修饰的所有会随同加载。 5.通过类访问静
相关文章
相关标签/搜索