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

Java´´½¨¶ÔÏóµÄÈýÖÖ·½·¨

Ò»¡¢new
¡¡¡¡Ê¹ÓÃjavaµÄ¹Ø¼ü×ÖnewÀ´´´½¨¶ÔÏóʵÀý¡£¹¹Ô캯ÊýÁ´ÖеÄËùÓй¹Ô캯Êý¶¼»á±»×Ô¶¯µ÷Óá£
     Java´úÂ룺
¡¡¡¡  CreateInstance  instance = new  CreateInstance  ();
¶þ¡¢clone
      ¹¹Ô캯Êý²»±»×Ô¶¯µ÷Óá£
¡¡¡¡Java´úÂ룺 
¡¡¡¡¡¡public class CreateInstance  implements Cloneable{
¡¡¡¡¡¡¡¡public CreateInstance getInstance() throws CloneNotSupportedException{
¡¡¡¡¡¡¡¡¡¡return (CreateInstance) this.clone();
            }
         }
¡¡¡¡Èç¹ûÐèÒª¸´ÖÆÉÏÃæµÄÄǸöobjÖ¸ÏòµÄ¶ÔÏóʵÀýʱ£¬µ÷ÓÃnew CreateInstance().getInstance()·½·¨¾ÍokÁË¡£
     µ«ÊÇΪʲô²»Ö±½ÓʹÓÃnew CreateInstance().clone()ÄØ£¿
        JDKÖÐObject# clone()·½·¨µÄÔ­ÐÍÊÇ£ºprotected native Object clone() throws¡¡ CloneNotSupportedException; ·½·¨ÐÞÊηûÊÇprotected£¬¶ø²»ÊÇpublic¡£
     ÕâÖÖ·ÃÎʵIJ»¿É¼ûÐÔʹµÃÎÒÃǶÔObject#clone()·½·¨²»¿É¼û¡£ËùÒÔ£¬±ØÐèÖØдObjectµÄclone·½·¨ºó²ÅÄÜʹÓá£
     Java´úÂ룺 
¡¡¡¡¡¡public class CreateInstance  implements Cloneable{
¡¡¡¡¡¡¡¡public CreateInstance clone throws CloneNotSupportedException{
¡¡¡¡¡¡¡¡¡¡return (CreateInstance) super.clone();
            }
         }
      ÖµµÃ×¢ÒâµÄÊÇ £ºÈç¹ûÐèҪʹÓÃclone·½·¨£¬±ØÐèʵÏÖjava.lang.Cloneable½Ó¿Ú£¬·ñÔò»áÅ׳öjava.lang.CloneNotSupportedException¡£
      ÁíÍâclone·½·¨Ëù×öµÄµÄ²Ù×÷ÊÇÖ±½Ó¸´ÖÆ×ֶεÄÄÚÈÝ£¬»»¾ä»°Ëµ£¬Õâ¸ö²Ù×÷²¢²»¹Ü¸Ã×ֶζÔÓ¦µÄ¶ÔÏóʵÀýÄÚÈÝ¡£
      ÏñÕâÑù×ֶζÔ×ֶεĿ½±´£¨field to field copy£©¾Í³ÉΪ"dz¿½±´"£¬clone·½·¨Ëù×öµÄÕýÊÇ"dz¿½±´"¡£
Èý¡¢newInstance
      ÀûÓÃjava.lang.ClassÀàµÄnewInstance·½·¨£¬Ôò¿É¸ù¾ÝClass¶ÔÏóµÄʵÀý£¬½¨Á¢¸ÃClassËù±í


Ïà¹ØÎĵµ£º

java ÈÃÎÒÈçºÎÈ¥°®Äã

Èí¼þ¼¼ÊõµÄѸÃÍ·¢Õ¹ÈÃJava
ÊÀ½çµÄWeb ¿ò¼Ü
ÁìÓò
·çÆðÔÆÓ¿£¬¸÷Öּܹ¹²ã³ö²»Çµ«ÄãÄÇ?
¡¡¡¡»Øµ½ÁùÄêÇ°µÄ½ñÌì̸ÂÛÕâ¸ö»°Ì⣬ÎÒ»áÍÑ¿Ú¶ø³ö£ºStruts. ÄÇÊÇÒ»¸ö¶ÔStruts¼¸ºõ³ç°ÝµÄʱ´ú£¬¼¸ºõûÈ˶ÔÆäÖÊÒÉ¡£ÄÇʱJava
ÊÀ½çµÄWeb

frameworkÊÀ½çÈç´Ë"µ¥´¿"£¬µ¥´¿µÃÈç´Ë¿ìÀÖ¡£
¡¡¡¡¾­µä£¬¿°³Æ¾­µä¡£ÌÈÈôÎÒÔÚ´ËÊ ......

JAVAÖµ´«µÝ(call by value)

public class Foo {
 static void operate(StringBuffer x,StringBuffer y){
  x.append(y);
  y=x;
 }
 public static void main(String args[]){
  StringBuffer a = new StringBuffer("A");
  StringBuffer b = new StringBuffer("B");
  
& ......

¹ØÓÚjavaÖеÄURLÀàµÄʹÓÃÒ»¸öÎÊÌâ


      ÎÒʹÓÃURLÀàÀ´·ÃÎÊFTP·þÎñÆ÷£¬µ±µØÖ·ÖÐûÓÐÖÐÎÄʱûÓÐÎÊÌ⣬µ«ÊÇ
    µ±ftpÖеÄÎļþ¼ÐÓÐÖÐÎÄʱ£¬¾ÍÎÞ·¨·ÃÎÊÁË£¬ÎÒÊÔ¹ýencoderºÍdecoderÀ࣬¶¼²»ÐУ¬ÓÐʲô½â¾ö·½·¨Ã´£¿
            URL now = new URL("ftp://202.204.208.124/Èí¼þ/");
......

תÌùµÄjavaÃæÊÔÌâ,ÓпÕ×ö×ö¿´

תÁíÒ»¸öÂÛ̳µÄÌû×Ó£º
ѸÀ×ÃæÊÔ»ØÀ´£¬ÓÃÁËÕûÕûÒ»ÏÂÎ磨²»ÖªµÀÔõô˵ÁË£¬ÆäÖеȴýʱ¼ä¶¼¿ì2СʱÁË£©£¬×Ô¼º¸Ð¾õ±ÊÊÔºÍÉÏ»ú»¹¿ÉÒÔ£¬µ«¼¼ÊõÃæ̸ÕâÒ»¹Ø´ðµÃ²»Ì«ºÃ£¬ÏÖÔÚÔٴθоõ»¥ÁªÍø¹«Ë¾ÓëÒ»°ãÈí¼þ¹«Ë¾µÄÇø±ðÁË£¬ÆäÖÐÒ»µã¾ÍÊÇ»¥ÁªÍøÓ¦ÓÃÔÚÐÔÄÜÉÏÒªÇóºÜ¸ß£¬Ì¸ÁËÒ»¸öСʱ´ó²¿·ÖÌâÄ¿¸Ð¾õ¶¼ÔÚ̸ÂÛÐÔÄÜÎÊÌ⣬×Ô¼ºÔÚ·½ÃæÒ»Ö±ÊÇÈõÏî ......

[±¸·Ý]javaÖÐXML½âÎöÀûÆ÷ dom4jµÄʹÓüò½é


ҪʹÓÃdom4j¶ÁдXMLÎĵµ,ÐèÒªÏÈÏÂÔØdom4j°ü,dom4j¹Ù·½ÍøÕ¾ÔÚ http://www.dom4j.org/
Ä¿Ç°×îÐÂdom4j°üÏÂÔصØÖ·: http://nchc.dl.sourceforge.net/sourceforge/dom4j/dom4j-1.6.1.zip
½â¿ªºóÓÐÁ½¸ö°ü,½ö²Ù×÷XMLÎĵµµÄ»°°Ñdom4j-1.6.1.jar¼ÓÈ빤³Ì¾Í¿ÉÒÔÁË,Èç¹ûÐèҪʹÓÃXPathµÄ»°»¹ÐèÒª¼ÓÈë°üjaxen-1.1-beta-7.jar.
ÒÔÏÂ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ