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

JAVA¼òµ¥¸ÅÄî

1.ʵÀý³ÉÔ±ºÍÀà³ÉÔ±
ʵÀý³ÉÔ±ÖÐÊÇÊôÓÚ¶ÔÏóµÄ,°üÀ¨ÊµÀý³ÉÔ±±äÁ¿ºÍʵÀý³ÉÔ±·½·¨,Ö»Óд´½¨Á˶ÔÏóÖ®ºó²ÅÄÜ·ÃÎÊʵÀý³ÉÔ±±äÁ¿ºÍʵÀý³ÉÔ±·½·¨.
    Àà³ÉÔ±ÊÇÊôÓÚÀàµÄ,Àà³ÉÔ±ÐèÒªÓùؼü×Östatic±êʶ,Ò²³ÆÎª¾²Ì¬³ÉÔ±,Àà³ÉÔ±°üÀ¨Àà³ÉÔ±±äÁ¿ºÍÀà³ÉÔ±·½·¨,ͨ¹ýÀàÃû¿ÉÒÔÖ±½Ó·ÃÎÊÀà³ÉÔ±±äÁ¿ºÍµ÷ÓÃÀà³ÉÔ±·½·¨,¼´Ê¹Ã»Óд´½¨¶ÔÏó,Ò²Äܹ»ÒýÓÃÀà³ÉÔ±,Àà³ÉÔ±Ò²¿ÉÒÔͨ¹ý¶ÔÏóÒýÓÃ.
    ½ÓÏÂÀ´½²½²Àà±äÁ¿ºÍʵÀý±äÁ¿µÄÇø±ð:
£¨1£©: ÉùÃ÷µÄ²î±ð: ûÓÐʹÓÃstaticÉùÃ÷µÄΪʵÀý³ÉÔ±±äÁ¿,ÓÃstatic ÉùÃ÷µÄΪÀà³ÉÔ±±äÁ¿
£¨2£©:´æ´¢½á¹¹µÄ²î±ð: ¶ÔÓÚʵÀý±äÁ¿¶øÑÔ,Ϊÿ¸ö¶ÔÏóµÄÿ¸öʵÀý³ÉÔ±±äÁ¿·ÖÅäÒ»¸ö´æ´¢µ¥ÔªÊ¹µÃ²»Í¬¶ÔÏóµÄʵÀý³ÉÔ±±äÁ¿¾ßÓв»Í¬µÄÖµ,¶ø¶ÔÓÚÀà³ÉÔ±±äÁ¿Ö»·ÖÅäÒ»¸ö´æ´¢µ¥Ôª,ʹµÃËùÓеĶÔÏó¹²Í¬Ê¹ÓÃÒ»¸öÀà³ÉÔ±±äÁ¿.
£¨3£©:ÒýÓ÷½Ê½µÄ²î±ð: ʵÀý³ÉÔ±±äÁ¿¶ÔÓÚ¶ÔÏó,ͨ¹ý¶ÔÏó½øÐзÃÎÊ;Àà³ÉÔ±±äÁ¿ÊôÓÚÀà,¼È¿ÉÒÔͨ¹ý¶ÔÏó,Ò²¿ÉÒÔͨ¹ýÀà·ÃÎÊ.
2.equals ·½·¨½âÎö£º£¨¡¶JAVAºËÐļ¼Êõ¡·176Ò³£©
£¨1£©¶ÔÓÚ×Ö·û´®±äÁ¿À´Ëµ£¬Ê¹ÓÓ==”ºÍ“equals()”·½·¨±È½Ï×Ö·û´®Ê±£¬Æä±È½Ï·½·¨²»Í¬¡£
“==”±È½ÏÁ½¸ö±äÁ¿±¾ÉíµÄÖµ£¬¼´Á½¸ö¶ÔÏóÔÚÄÚ´æÖеÄÊ×µØÖ·¡£“equals()”±È½Ï×Ö·û´®ÖÐËù°üº¬µÄÄÚÈÝÊÇ·ñÏàͬ¡£
£¨2£©¶ÔÓÚ·Ç×Ö·û´®±äÁ¿À´Ëµ£¬"=="ºÍ"equals"·½·¨µÄ×÷ÓÃÊÇÏàͬµÄ¶¼ÊÇÓÃÀ´±È½ÏÆä
¶ÔÏóÔÚ¶ÑÄÚ´æµÄÊ×µØÖ·£¬¼´ÓÃÀ´±È½ÏÁ½¸öÒýÓñäÁ¿ÊÇ·ñÖ¸Ïòͬһ¸ö¶ÔÏó¡£
public boolean equals(Object obj)ָʾÆäËûij¸ö¶ÔÏóÊÇ·ñÓë´Ë¶ÔÏó“ÏàµÈ”¡£
equals ·½·¨ÔڷǿնÔÏóÒýÓÃÉÏʵÏÖÏàµÈ¹ØÏµ£º
×Ô·´ÐÔ£º¶ÔÓÚÈκηǿÕÒýÓÃÖµ x£¬x.equals(x) ¶¼Ó¦·µ»Ø true¡£
¶Ô³ÆÐÔ£º¶ÔÓÚÈκηǿÕÒýÓÃÖµ x ºÍ y£¬µ±ÇÒ½öµ± y.equals(x) ·µ»Ø true ʱ£¬x.equals(y) ²ÅÓ¦·µ»Ø true¡£
´«µÝÐÔ£º¶ÔÓÚÈκηǿÕÒýÓÃÖµ x¡¢y ºÍ z£¬Èç¹û x.equals(y) ·µ»Ø true£¬²¢ÇÒ y.equals(z) ·µ»Ø true£¬ÄÇô x.equals(z) Ó¦·µ»Ø true¡£
Ò»ÖÂÐÔ£º¶ÔÓÚÈκηǿÕÒýÓÃÖµ x ºÍ y£¬¶à´Îµ÷Óà x.equals(y) ʼÖÕ·µ»Ø true »òʼÖÕ·µ»Ø false£¬Ç°ÌáÊǶÔÏóÉÏ equals ±È½ÏÖÐËùÓõÄÐÅϢûÓб»Ð޸ġ£
¶ÔÓÚÈκηǿÕÒýÓÃÖµ x£¬x.equals(null) ¶¼Ó¦·µ»Ø false¡£
Object ÀàµÄ equals ·½·¨ÊµÏÖ¶ÔÏóÉϲî±ð¿ÉÄÜÐÔ×î´óµÄÏàµÈ¹ØÏµ£»¼´£¬¶ÔÓÚÈκηǿÕÒýÓÃÖµ x ºÍ y£¬µ±ÇÒ½öµ± x ºÍ y ÒýÓÃͬһ¸ö¶ÔÏóʱ£¬´Ë·½·¨²Å·µ»Ø true£¨x == y ¾ßÓÐÖµ true£©¡£
×¢Ò⣺µ±´Ë·½


Ïà¹ØÎĵµ£º

JavaÃØÊ·£ºÒþ²ØÔÚSWT/Swing±³ºóµÄ¹ÊÊÂ

Òë×¢
£º±¾ÎÄÀ´×Ôstraight_talking_java@yahoogroups.comÌÖÂÛ×飬ÒѾ­ÊÇÒ»Äê¶àǰ
µÄÎÄÕ¡£Alan WilliamsonÊÇJava Developers
JournalµÄ±à¼­£¬ÏÂÎÄÀ´×ÔËûÔÚIBMµÄÒ»¸öÏûÏ¢À´Ô´¡£SWTºÍSwingµÄÂÛÕùÎÒ¼û¹ý²»ÉÙ£¬NetbeansºÍEclipseµÄҲͬÑù¶à¡£ÒëÕß·­Òë
´ËÎIJ¢²»ÊÇÒª¼¤ÆðʲôÕùÖ´£¬Ò²²»ÊÇÖ§³ÖÄÄÒ»·½£¨ËäÈ»ÎÒµÄÈ·ÊÇÕ¾ÔÚSWTÒ»±ßµ ......

¶þ¡¢£¨1£©Êý¾Ý²ã ÓйØJava´úÂë

l×é¼þ´Ó¹¦ÄÜÉÏ·Ö¿É·ÖΪ£º
   1) ¶¥²ãÈÝÆ÷£ºJFrame,JApplet,JDialog,JWindow
   2) ÖмäÈÝÆ÷£ºJPanel,JScrollPane,JSplitPane,JToolBar¡¡
   3) ÌØÊâÈÝÆ÷£ºÔÚGUIÉÏÆðÌØÊâ×÷ÓõÄÖмä²ã£¬ÈçJInternalFrame,JLayeredPane,JRootPane.
1.JFrameµÄÓ÷¨
1) ÓÃgetContentPane( )·½·¨»ñµÃJFrameµÄ ......

½«Java¶ÔÏó±£´æÎªXMLÎĵµ

package com.kiloway.trace.utils;
import java.lang.reflect.Field;
/**
* @author Zhang Qi
* @Create Time 2010/01/09
* */
public class ObjectToXML {
public String toString(Object object) throws Exception {
StringBuilder sb = new StringBuilder();
//µÃµ½ÀàµÄÃû³Æ
String classname = obj ......

JavaÖÐJNDIµÄÅäÖÃ

·½°¸Ò»²½Ö裺
1¡¢ÅäÖÃTomcat\conf\context.xmlÌí¼Ó <Resource>
 <Resource name="jdbc/books" auth="Container"
  type="javax.sql.DataSource" maxActive="100" maxIdle="30"
  maxWait="10000" username="sa" password=""
  driverClassName="com.microsoft.jdbc.sqlse ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ