javaÖеÄfinal£¬static¹Ø¼ü×Ö
¹Ø¼ü×Öfinal£º
ÔÚJavaÖÐÉùÃ÷Àà¡¢ÊôÐԺͷ½·¨Ê±£¬¿ÉʹÓùؼü×ÖfinalÀ´ÐÞÊΡ£
final±ê¼ÇµÄÀ಻Äܱ»¼Ì³Ð¡£
final±ê¼ÇµÄ·½·¨²»Äܱ»×ÓÀàÖØд¡£
final±ê¼ÇµÄ±äÁ¿(³ÉÔ±±äÁ¿»ò¾Ö²¿±äÁ¿)¼´³ÉΪ³£Á¿£¬Ö»Äܸ³ÖµÒ»´Î¡£
final±ê¼ÇµÄ³ÉÔ±±äÁ¿±ØÐëÔÚÉùÃ÷µÄͬʱ»òÔÚÿ¸ö¹¹Ôì·½·¨ÖÐÏÔʽ¸³Öµ£¬È»ºó²ÅÄÜʹÓá£
static¹Ø¼ü×Ö£º
ÔÚJavaÀàÖÐÉùÃ÷±äÁ¿¡¢·½·¨ºÍÄÚ²¿Ààʱ£¬¿ÉʹÓùؼü×Östatic×öΪÐÞÊηû¡£
static±ê¼ÇµÄ±äÁ¿»ò·½·¨ÓÉÕû¸öÀà(ËùÓÐʵÀý)¹²Ïí£¬Èç·ÃÎÊ¿ØÖÆȨÏÞÔÊÐí£¬¿É²»±Ø´´½¨¸ÃÀà¶ÔÏó¶øÖ±½ÓÓÃÀàÃû¼Ó‘.’µ÷Óá£
static³ÉÔ±Ò²³ÆÀà³ÉÔ±»ò¾²Ì¬³ÉÔ±£¬È磺ÀàÊôÐÔ¡¢Àà·½·¨¡¢¾²Ì¬·½·¨µÈ¡£
×¢Ò⣺²»Òª°ÑfinalºÍstatic¸ã»ì£¬static¿ÉÒÔÎÞÏ޴θ³Öµ£¬¶øfinalÖ»ÄÜÒ»´Î£¡
public final class Test{
public static int totalNumber= 5 ;
public final int id;
public Test(){
id = ++totalNumber;
}
public static void main(String[] args) {
Test t = new Test();
System.out.println(t.id);
final int i = 10;
final int j;
j = 20;
j = 30; //·Ç·¨£¬ÒòΪfinal±ê¼ÇµÄ±äÁ¿Ö»Äܱ»¸³ÖµÒ»´Î
}
}
Ïà¹ØÎĵµ£º
Ò»£º×¼±¸ www.savarese.org download
1. rocksaw-1.0.0-src.tar.gz
2. vserv-tcpip-0.9.2-src.tar.gz
¶þ£º±àÒëÔ´ÎļþµÃµ½jar°ü ʹÓÃAnt
1. build vserv-tcpip-0.9.2-src
ÔÚvserv-tcpip-0.9.2Ŀ¼ÏÂÃ潨һ¸ötestsĿ¼£¬È»ºóÔÚcmd´°¿ÚϽøÈë ......
Ò»¡¢JAVA»ñÈ¡Ëæ»úÊýµÄ·½·¨
//ʹÓÃjava.lang.MathÀàµÄrandom()·½·¨
double a = Math.random();
System.out.println("0.0-1.0µÄËæ»úÊý£º" + a);
double b = Math.random()*100;
System.out.println("0.0-100.0µÄËæ»úÊý£º" + b);
int c = (int)(Math.random()*100);
System.out.println("0-100µÄËæ»úÕûÊý£º" + c);  ......
×÷Ϊ¶ÔÏóµÄ´´½¨Ä£Ê½,µ¥Àýģʽȷ±£Ä³¸öÀàÖ»ÓÐÒ»¸öʵÀý£¬¶øÇÒ×ÔÐÐʵÀý»¯²¢ÏòÕû¸öϵͳÌṩÕâ¸öʵÀý¡£Õâ¸öÀà³ÆΪµ¥ÀýÀà¡£Óɶ¨Òå¿ÉÒÔ×ܽá³öµ¥ÀýģʽµÄÒªµãÓÐÈý¸ö£ºÒ»Êǵ¥ÀýÀàÖ»ÄÜÓÐÒ»¸öʵÀý£»¶þÊÇËü±ØÐë×ÔÐд´½¨Õâ¸öʵÀý£»ÈýÊÇËü±ØÐë×ÔÐÐÏòÕû¸öϵͳÌṩÕâ¸öʵÀý¡£
ÔÚ¼ÆËã»úϵͳÖУ¬Ï̳߳ء¢»º´æ¡¢ÈÕÖ ......
http://java.csdn.net/index.php/2009/09/01/java%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%80%E5%B8%B8%E5%8E%BB%E7%9A%8420%E4%B8%AA%E8%8B%B1%E6%96%87%E7%BD%91%E7%AB%99/
JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾
1.[http://www.javaalmanac.com
] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´ú ......
Ŀ¼
¡¡¡¡Ç°ÑÔ
¡¡¡¡Ò». Java ÎĵµºÍ javadoc
¡¡¡¡¶þ. Îĵµ×¢Ê͵ĸñʽ
¡¡¡¡¡¡¡¡1. Îĵµ×¢Ê͵ĸñʽ»¯
¡¡¡¡¡¡¡¡2. Îĵµ×¢Ê͵ÄÈý²¿·Ö
¡¡¡¡Èý. ʹÓà javadoc ±ê¼Ç
¡¡¡¡¡¡¡¡1. @see µÄʹÓÃ
¡¡¡¡¡¡¡¡2. ʹÓà @author¡¢@version ˵Ã÷Àà
¡¡¡¡¡¡¡¡3. ʹÓà @param¡¢@return ºÍ @exception ˵Ã÷·½·¨
¡¡¡ ......