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

JavaÖеÄÖµ´«µÝÓëÒýÓô«µÝ


Ò».Á½¸ö¸ÅÄî
ʵ¼Ê²ÎÊý(ʵ²Î):·½·¨µ÷ÓÃʱ±»´«ÈëµÄ²ÎÊý
ÐβÎ:·½·¨¶¨ÒåʱÉùÃ÷µÄ²ÎÊý
¶þ.ÈýÖÖ´«µÝ·½Ê½
1.»ù±¾Êý¾ÝÀàÐ͵ÄÖµ´«µÝ:
public static void main(String []args)
 {
  int i=10,j=5;
  tValue(i,j);
  System.out.println("i:"+i+"j:"+j);//´òÓ¡½á¹û:i=10,j=5
 }
 public static void tValue(int x,int y)
 {
  x+=y;
  y=x;
 }
×ܽ᣺Éæ¼°µ½»ù±¾Êý¾ÝÀàÐ͵Ĵ«µÝʱ£¬ÐβνÓÊܵÄÊÇʵ²ÎµÄÖµ¸±±¾¡£ËùÒÔ²»Äܸıäʵ²ÎµÄÖµ
2.¸´ºÏÀàÐ͵ÄÒýÓô«µÝ
void method1() {
¡¡¡¡2 StringBuffer x = new StringBuffer("Hello");
¡¡¡¡3 change1(x);
¡¡¡¡4 System.out.println(x);
¡¡¡¡5 }
¡¡¡¡6
¡¡¡¡7 void method2() {
¡¡¡¡8 StringBuffer x = new StringBuffer("Hello");
¡¡¡¡9 change2(x);
¡¡¡¡10 System.out.println(x);
¡¡¡¡11 }
¡¡¡¡12
¡¡¡¡13 void change1(StringBuffer sb) {
¡¡¡¡14 sb.append(" world!");
¡¡¡¡15 }
¡¡¡¡16
¡¡¡¡17 void change2(StringBuffer sb) {
¡¡¡¡18 sb = new StringBuffer("hi");
¡¡¡¡19 sb.append(" world!");
¡¡¡¡20 }
Õë¶ÔÒÔÉÏ´úÂ룬×ܽá2Ìõ£º1.¶ÔÓÚÀàµÄʵÀýËü´«µÝµÄÊÇÀàµÄÒýÓá£ÐèҪעÒâµÄÊÇ£¬ÕâÌõ¹æÔòÖ»ÊÊÓÃÓÚ²ÎÊý´«µÝ
2.¶ÔÓÚº¯Êýµ÷Óã¬×îÖÕЧ¹ûÊÇʲôÍêÈ«¿´º¯ÊýÄÚ²¿µÄʵÏÖ¡£Èç18ÐдúÂë
Èý¡£¸´ºÏÀàÐ͵ÄÖÐStringµÄÌØÊâÒýÓô«µÝ
public  class Example{
String str=new String("good");
char [] ch=;
public static void main(String args[]){
Example ex=new Example();
ex.change(ex.str,ex.ch);
System.out.print(ex.str+"and");
System.out.print(ex.ch);
}
public void change(String str2,char ch[]){
str="testok";
ch[0]='g';
System.out.print(str);
}
}strµÄ´«µÝÓëÖµ´«µÝÏàËÆ


Ïà¹ØÎĵµ£º

java¶ÁÈ¡xmlÎļþµÄËÄÖÖ·½·¨

xmlÎļþ£º
Xml´úÂë
<?xml version="1.0" encoding="GB2312"?>  
<RESULT>  
 <VALUE>¡¡¡¡   
  <NO>A1234</NO>¡¡¡¡   
  <ADDR>ºÓÄÏÊ¡Ö£ÖÝÊÐ</ADDR>  
 </VALUE>&nbs ......

javaÖеõ½µ±Ç°Â·¾¶µÄ·½·¨


¹éÄÉһЩÍøÉÏÈ¡JAVA·¾¶µÄ·½·¨£º
×¢Ã÷£ºÈç¹û´ÓANTÆô¶¯³ÌÐò£¬this.getClass().getResource("")È¡³öÀ´µÄ±È½Ï¹Ö£¬Ö±½ÓÓÃJAVAÃüÁîÐе÷ÊԾͿɳɹ¦¡£
µÃµ½classpathºÍµ±Ç°ÀàµÄ¾ø¶Ô·¾¶µÄһЩ·½·¨
»ñµÃCLASSPATHÖ®Íâ·¾¶µÄ·½·¨£º
URL base = this.getClass£¨£©.getResource£¨""£©£» //ÏÈ»ñµÃ±¾ÀàµÄËùÔÚλÖã¬Èç/home/popeye/ ......

ÉîÈëjavaÒì³£»úÖÆ

ת×Ôwww.bitsCN.com
ÕªÒª£º±¾ÎÄ´ÓJavaÒì³£×î»ù±¾µÄ¸ÅÄî¡¢Óï·¨¿ªÊ¼½²ÊöÁËJavaÒì³£´¦ÀíµÄ»ù±¾ÖªÊ¶£¬·ÖÎöÁËJavaÒì³£Ìåϵ½á¹¹£¬¶Ô±ÈSpringµÄÒì³£´¦Àí¿ò
¼Ü£¬²ûÊöÁËÒì³£´¦ÀíµÄ»ù±¾Ô­Ôò¡£²¢ÇÒ×÷ÕßÌá³öÁË×Ô¼º´¦ÀíÒ»¸ö´óÐÍÓ¦ÓÃϵͳÒì³£µÄ˼Ï룬²¢Í¨¹ýÉè¼ÆÒ»¸öÒì³£´¦ÀíµÄ¿ò¼ÜÀ´ÂÛÊö´Ë˼Ïë¡£
    Ò»¡¢ Òì³£µÄ¸ÅÄîº ......

java SocketµÄ¹ÖÒìÖ®´¦

¹ÖÒìÖ®Ò»£º
connect(SocketAddress endpoint):Õâ¸ö·½·¨£¬³¢ÊÔÁ¬½Óserver¶Ë£¬Èç¹ûÁ¬½Ó²»ÉÏ£¬¾ÍÅ׳öIOExceptionÒì³£¡£Èç¹ûÁ¬½Ó³É¹¦ÁË£¬¾Í¼ÌÐøÖ´ÐÐÏÂÒ»²½µÄ´úÂë¡£
¹ÖÒìÖ®¶þ£º
boolean isConnected()  :Õâ¸ö·½·¨µÄ½á¹û½ö½ö´ú±íÕâ¸ösocketÔø¾­³É¹¦Á¬½Óµ½ÁËserver£¬µ«²¢²»±íʾÏÖÔÚÕâ¸öʱ¿ÌËüºÍserverÈÔ±£³ÖÁ¬½Ó״̬¡£
ÓÐ ......

think in javaµÚÊ®ÎåÕ¹ØÓÚÍøÂç±à³ÌµÄ¶ÁÊé±Ê¼Ç

      ¶ÔÓÚjavaµÄÍøÂç±à³ÌÊéÖÐÌÖÂÛµÄÈ«²¿¹éÄÉÆðÀ´ÓÐSocketµÄʹÓã¬DatagramSocketµÄʹÓã¬javaÓëCGIµÄÅäºÏʹÓã¬javaÁ¬½ÓÊý¾Ý¿âÒÔ¼°javaÖе÷ÓÃÔ¶³Ì·½·¨¡£
     
Ê×ÏÈÊÇSocketµÄʹÓ㬶ÔÓÚ·þÎñ¶ËÀ´Ëµ£¬Ó¦¸ÃÉùÃ÷µÄÊÇServerSocket¶ÔÏó£¬È»ºóʹÓÃSocket
accept()·½·¨½øÐÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ