Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaÖеķ´Éä»úÖÆ

JAVA·´Éä»úÖÆ
    JAVA·´Éä»úÖÆÊÇÔÚÔËÐÐ״̬ÖУ¬¶ÔÓÚÈÎÒâÒ»¸öÀ࣬¶¼Äܹ»ÖªµÀÕâ¸öÀàµÄËùÓÐÊôÐԺͷ½·¨£»¶ÔÓÚÈÎÒâÒ»¸ö¶ÔÏ󣬶¼Äܹ»µ÷ÓÃËüµÄÈÎÒâÒ»¸ö·½·¨£»ÕâÖÖ¶¯Ì¬»ñÈ¡µÄÐÅÏ¢ÒÔ¼°¶¯Ì¬µ÷ÓöÔÏóµÄ·½·¨µÄ¹¦ÄܳÆΪjavaÓïÑԵķ´Éä»úÖÆ¡£
Java·´Éä»úÖÆÖ÷ÒªÌṩÁËÒÔϹ¦ÄÜ£º ÔÚÔËÐÐʱÅжÏÈÎÒâÒ»¸ö¶ÔÏóËùÊôµÄÀࣻÔÚÔËÐÐʱ¹¹ÔìÈÎÒâÒ»¸öÀàµÄ¶ÔÏó£»ÔÚÔËÐÐʱÅжÏÈÎÒâÒ»¸öÀàËù¾ßÓеijÉÔ±±äÁ¿ºÍ·½·¨£»ÔÚÔËÐÐʱµ÷ÓÃÈÎÒâÒ»¸ö¶ÔÏóµÄ·½·¨£»Éú³É¶¯Ì¬´úÀí¡£
1. µÃµ½Ä³¸ö¶ÔÏóµÄÊôÐÔ
1 public Object getProperty(Object owner, String fieldName) throws Exception {
2     Class ownerClass = owner.getClass();

4     Field field = ownerClass.getField(fieldName);

6     Object property = field.get(owner);

8     return property;
9 }
Class ownerClass = owner.getClass()£ºµÃµ½¸Ã¶ÔÏóµÄClass¡£
Field field = ownerClass.getField(fieldName)£ºÍ¨¹ýClassµÃµ½ÀàÉùÃ÷µÄÊôÐÔ¡£
Object property = field.get(owner)£ºÍ¨¹ý¶ÔÏóµÃµ½¸ÃÊôÐÔµÄʵÀý£¬Èç¹ûÕâ¸öÊôÐÔÊǷǹ«Óеģ¬ÕâÀï»á±¨IllegalAccessException¡£
2. µÃµ½Ä³¸öÀàµÄ¾²Ì¬ÊôÐÔ
 1 public Object getStaticProperty(String className, String fieldName)
 2             throws Exception {
 3     Class ownerClass = Class.forName(className);
 4 
 5     Field field = ownerClass.getField(fieldName);
 6 
 7     Object property = field.get(ownerClass);
 8 
 9     return property;
10 }
Class ownerClass = Class.forName(className) £ºÊ×Ïȵõ½Õâ¸öÀàµÄClass¡£
Field field&n


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

JavaÓïÑÔÖÐthis, super, synchronized

1.
superÊǵ÷Óø¸ÀàµÄ¹¹Ô캯Êý
2.
thisµ÷ÓõÄͬÀàµÄ¹¹Ô캯Êý.
3.
3.1
synchronized¹Ø¼ü×ÖµÄ×÷ÓÃÓòÓжþÖÖ
3.1.1
ÊÇij¸ö¶ÔÏóʵÀýÄÚ£¬synchronized aMethod(){}¿ÉÒÔ·ÀÖ¹¶à¸öÏß³Ìͬʱ·ÃÎÊÕâ¸ö¶ÔÏóµÄsynchronized·½·¨£¨Èç¹ûÒ»¸ö¶ÔÏóÓжà¸ösynchronized·½·¨£¬Ö»ÒªÒ»¸öÏ̷߳ÃÎÊÁËÆäÖеÄÒ»¸ösynchronized·½·¨£¬ÆäËüÏ̲߳»ÄÜ ......

Java °ÑÎı¾ÖеÄÊý¾Ý²åÈëµ½MySqlÊý¾Ý¿â

Ò»¹²ÓÐÈý¸öÀࣺWriteFile ; ReadFile ; InsertDB ;
//WriteFile.java
//ÓÃÓÚ½«ÐÅϢдÈëÎı¾Îļþ
package org.mb.insertfromfile;
import java.io.*;
public class WriteFile{
private int count = 0 ;
public int getCount() {
return count;
}
public void setCount(int count) {
this.cou ......

Java°²×°ºóJDK/binĿ¼ÏµÄexeÎļþµÄÓÃ;

javac£ºJava±àÒëÆ÷£¬½«JavaÔ´´úÂë»»³É×Ö½Ú´ú
java£ºJava½âÊÍÆ÷£¬Ö±½Ó´ÓÀàÎļþÖ´ÐÐJavaÓ¦ÓóÌÐò´úÂë
appletviewer(С³ÌÐòä¯ÀÀÆ÷)£ºÒ»ÖÖÖ´ÐÐHTMLÎļþÉϵÄJavaС³ÌÐòÀàµÄJavaä¯ÀÀÆ÷
javadoc£º¸ù¾ÝJavaÔ´´úÂë¼°Æä˵Ã÷Óï¾äÉú³ÉµÄHTMLÎĵµ
jdb£ºJavaµ÷ÊÔÆ÷£¬¿ÉÒÔÖðÐеØÖ´ÐгÌÐò¡¢ÉèÖöϵãºÍ¼ì²é±äÁ¿
javah£º²úÉú¿ÉÒÔµ÷Ó ......

¹ØÓÚjava+flexÏîÄ¿»¶Ó­Ò³µÄÎÊÌâ

¿ª·¢Á˸öflexºÍjavaµÄ²âÊÔÏîÄ¿£¬ÒòΪflexÎļþ±È½Ï¶à£¬ËùÒÔ´´½¨flexʱºò£¬
ÔÚWebRootϽ¨Á¢ÁËÎļþ¼Ðbin£¬ÓÃÀ´´æ´¢htmlºÍswfÎļþ
ÏëÔÚä¯ÀÀÆ÷ÊäÈëhttp://localhost:8080/projectÖ±½Ó¿ÉÒÔ·ÃÎÊÎļþ¼ÐϵÄhtml
µÚÒ»£¬ÔÚWebRootϽ¨Á¢index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
&l ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ