JAVA·´ÉäºÍCLASSÀà
¸ÐлÔÎÄ×÷Õß:http://blog.sina.com.cn/s/blog_62a6ceb10100gwe0.html
JAVAÆäʵ²»ËãÊÇÒ»ÃŶ¯Ì¬ÓïÑÔ£¬µ«JAVAÖÐÈ´ÓÖÒ»ÖÖ»úÖÆ¿ÉÒÔ´ïµ½¶¯Ì¬µÄijÖÐЧ¹û£¬Õâ¾ÍÊÇJAVAÖеķ´Éä¡£
JAVA·´ÉäÖ¸µÄÊÇÎÒÃÇ¿ÉÒÔÓÚÔËÐÐʱ¼ÓÔØ¡¢Ì½Öª¡¢Ê¹ÓñàÒëÆÚ¼äÍêȫδ֪µÄclasses¡£
¶¼JavaÓиöObject class£¬ÊÇËùÓÐJava classesµÄ¼Ì³Ð¸ùÔ´£¬ÆäÄÚÉùÃ÷ÁËÊý¸öÓ¦¸ÃÔÚËùÓÐJava classÖб»¸ÄдµÄmethods£ºhashCode()¡¢equals()¡¢clone()¡¢toString()¡¢getClass()µÈ¡£ÆäÖÐgetClass()·µ»ØÒ»¸öClass ¶ÔÏó¡£
Class classÊ®·ÖÌØÊâ¡£ËüºÍÒ»°ãclassesÒ»Ñù¼Ì³Ð×ÔObject£¬ÆäʵÌåÓÃÒÔ±í´ïJava³ÌÐòÔËÐÐʱµÄclassesºÍinterfaces£¬Ò²ÓÃÀ´±í´ïenum¡¢array¡¢primitive Java types£¨boolean, byte, char, short, int, long, float, double£©ÒÔ¼°¹Ø¼ü´Êvoid¡£µ±Ò»¸öclass±»¼ÓÔØ£¬»òµ±¼ÓÔØÆ÷£¨class loader£©µÄdefineClass()±»JVMµ÷Óã¬JVM ±ã×Ô¶¯²úÉúÒ»¸öClass object
²úÉúClass¶ÔÏóµÄÈýÖÖ³£Ó÷½·¨£º
Class c1 = Class.forName ("Ö¸¶¨ÄãÒª²úÉú¶ÔÏóµÄÀàµÄȫ·¾¶");
String str = "abc";
¡¡¡¡Class c1 = str.getClass();//»ù±¾Êý¾ÝÀàÐÍÒ²¿ÉÒÔ»ñµÃClass¶ÔÏó¡£
//´´½¨¶ÔÏ󣬶ÔÏóµã getClass();
¡¡Button b = new Button();
¡¡ ¡¡Class c1 = b.getClass();
//¸ù¾Ý»ù±¾Êý¾ÝÀàÐ͵İü×°ÀàÀ´»ñÈ¡¶ÔÏó
Class c1 = Boolean.TYPE;
¡¡¡¡Class c2 = Byte.TYPE;
¡¡¡¡Class c3 = Character.TYPE;
¡¡¡¡Class c4 = Short.TYPE;
¡¡¡¡Class c5 = Integer.TYPE;
¡¡¡¡Class c6 = Long.TYPE;
¡¡¡¡Class c7 = Float.TYPE;
¡¡¡¡Class c8 = Double.TYPE;
¡¡¡¡Class c9 = Void.TYPE;
µÃµ½Î´ÖªÊôÐÔ£º
Field[] field = Àà¶ÔÏó.getDeclaredFields(); //ËüÊǵõ½ËùÓÐÊôÐÔ ËùÒÔ·µ»ØµÄÊÇÊý×é
Field[] field1 = Àà¶ÔÏó.getFileds() //ËüÊǵõ½ËùÓй«¹²ÊôÐÔ¡£
field[] filed2 = Àà¶ÔÏó.getDeclaredField(); //µÃµ½µ¥¸öÊôÐÔ
field[] filed2 = Àà¶ÔÏó.getField(); //µÃµ½µ¥¸ö¹«¹²µÄÊôÐÔ
µÃµ½Î´Öª·½·¨
getMethods()Êǵõ½ËùÓй«¹²·½·¨¡£
Ïà¹ØÎĵµ£º
Ò»£º×¼±¸ 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ÈÕ»ýÔÂÀÛ-1£ºJavaÖÐbooleanÀàÐ͵ÄλÔËËã
1. Ê×ÏȻعËÒ»ÏÂjavaÖеÄ8Öлù±¾ÀàÐͼ°Æä´æ´¢ËùÕ¼ÓõÄbitÊý¡£
ÀàÐÍ
bitÊý
byte
8
short
16
int
32
float
32
long
64
double
64
char
16
boolean
1
2. ÔٻعËÒ»ÏÂjavaµÄÔËËã·ûºÍÓÅÏȼ ......
¼¶±ð£º Öм¶
Àî Áè
, Èí¼þ¼Ü¹¹Ê¦, IBM
2009 Äê 12 ÔÂ 10 ÈÕ
Ëæ
×ŶàºË CPU µÄÈÕÒæÆÕ¼°£¬Ô½À´Ô½¶àµÄ Java
Ó¦ÓóÌÐòʹÓöàÏ̲߳¢ÐмÆËãÀ´³ä·Ö·¢»ÓÕû¸öϵͳµÄÐÔÄÜ¡£¶àÏ̵߳ÄʹÓÃÒ²¸øÓ¦ÓóÌÐò¿ª·¢ÈËÔ±´øÀ´Á˾޴óµÄÌôÕ½£¬²»ÕýÈ·µØʹÓöàÏ߳̿ÉÄÜÔì³ÉÏß³ÌËÀËø»ò×ÊÔ´¾º
Õù£¬µ¼ÖÂϵͳ̱»¾¡£Òò´Ë£¬ÐèÒªÒ»ÖÖÔËÐÐʱÏ̼߳à¿Ø¹¤ ......
³éÏóÀà(abstract class)£º
ÔÚclassÇ°¼ÓÉÏabstractµÄÀà¾ÍÊdzéÏóÀ࣬È磺public abstract class A{};
ÓÃabstract¹Ø¼ü×ÖÀ´ÐÞÊÎÒ»¸öÀàʱ£¬Õâ¸öÀà½Ð×ö³éÏóÀࣻÓÃabstractÀ´ÐÞÊÎÒ»¸ö·½·¨Ê±£¬¸Ã·½·¨½Ð×ö³éÏó·½·¨(³éÏó·½·¨Ã»Óз½·¨Ìå)¡£
º¬ÓгéÏó·½·¨µÄÀà±ØÐë±»ÉùÃ÷Ϊ ......