您的位置:首页 > 编程语言 > Java开发

[ReadingNotes] Search the links, static final in the java

2013-06-22 23:54 513 查看

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

[ReadingNotes] Search the links, static final in the java



pre {
background-color: #2f4f4f;line-height: 1.6;
FONT: 10.5pt Consola,"Bitstream Vera Sans", Courier New, helvetica;
color:wheat;
}
.h3 {
margin-left: 10pt;
}



[ReadingNotes] Search the links, static final in the java

Find As You Type for the firefox

Press '/' will only find the links. And 'Enter' will activate the link.

static, final in the Java

static 特性
永遠會是一個唯一值!!
static可以透過類別直接存取使用!

相較於static,final的概念就容易了解許多!

可以用來宣告一個類別、函數、或者變數。

類別:當宣告在類別上時,該類別就無法被繼承!

函數:當一個函數被宣告為final時,則繼承他的子類別無法覆寫

變數:當一個變數被宣告為final時,意思是他是一個常數,是無法被修改的。

from http://blog.kenyang.net/2011/03/java-staticfinal.html

并且static变量在所有的派生类中共享:

Post by: Jalen Wang (转载请注明出处)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: