modifier

来源:互联网 发布:淘宝商品主图片尺寸 编辑:程序博客网 时间:2024/05/01 06:06

1 Any methods in a final class are automatically final.

2 A final variable cannot have it's value changed and must be set at creation time. This is similar to the idea of a constant in other languages.

3

Modifier

Method

Variable

class

public

yes

yes

yes

private

yes

yes

yes (nested)

protected

yes

yes

yes(nested)

abstract

yes

no

yes

final

yes

yes

yes

transient

no

yes

no

native

yes

no

no

volatile

no

yes

no

原创粉丝点击