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 SwingÖеÄJTreeÄ£ÐÍ
2009-01-04 10:40
±¾ÎĽéÉÜJava SwingÖеÄJTreeÄ£ÐÍ£¬½éÉÜÈçºÎ´´½¨¡¢Ð޸ġ¢±éÀú£¬ÉèÖÃÊ÷¡£²Î¿¼Core Java2Ïà¹ØÕ½ڼ°ÆäÔ´´úÂë¡£
SwingÊ÷ʹÓÃÈËÃÇËùÊìϤµÄÎļþ¼ÐºÍÊ÷ҶͼÀ´ÏÔʾ·Ö²ãµÄÊý¾Ý¡£Ê÷Óɽڵã×é³É£¬½Úµã¿ÉÒÔÊÇÎļþ¼Ð£¬Ò²¿ÉÒÔÊÇÊ÷Ò¶¡£Îļþ¼Ð¿ÉÒÔÓÐ×ӽڵ㣬³ý¸ù½ÚµãÖ®ÍâµÄËùÓнڵ㶼ֻÓÐÒ»¸ö¸ ......
²»Öª²»¾õ×öÈí¼þÒѾ×öÁËÊ®Ä꣬Óгɹ¦µÄϲÔã¬Ò²ÓÐʧ°ÜµÄÍ´¿à£¬µ«×ܲ»¸Ò³Æ×Ô¼ºÊǸßÊÖ£¬ÒòΪºÍÎÒÐÄÄ¿ÖÐÕæÕýµÄ¸ßÊÖÃÇ±ÈÆðÀ´£¬»¹²îµÄ̫Զ¡£ÊÀ½çÉϲ¢Ã»ÓгÉΪ¸ßÊֵĽݾ¶£¬µ«Ò»Ð©»ù±¾ÔÔòÊÇ¿ÉÒÔ×ñѵġ£
¡¡¡¡1. ÔúʵµÄ»ù´¡¡£Êý¾Ý½á¹¹¡¢ÀëÉ¢Êýѧ¡¢±àÒëÔÀí£¬ÕâЩÊÇËùÓмÆËã»ú¿ÆÑ§µÄ»ù´¡£¬Èç¹û²»ÕÆÎÕËûÃÇ£¬ºÜÄÑд³ö¸ßˮƽµÄ ......
ÔÚʵ¼ÊÏîÄ¿Öиø¶¨Ò»Îļþ¼Ð£¬µÃµ½Õâ¸öÎļþ¼ÐÏÂËùÓеÄÎļþÕâÑùµÄÐèÇó²¢²»ÊǺܶ࣬¸ü¶àµÄÊDzéÕÒ»òÊÇɾ³ýijһ¾ßÌåµÄÎļþ
import java.io.File;
import java.util.ArrayList;
public class FileTest {
private static ArrayList<String> filelist = new ArrayList<String>();
public stati ......
¶ÔÓÚjavaµÄÍøÂç±à³ÌÊéÖÐÌÖÂÛµÄÈ«²¿¹éÄÉÆðÀ´ÓÐSocketµÄʹÓã¬DatagramSocketµÄʹÓã¬javaÓëCGIµÄÅäºÏʹÓã¬javaÁ¬½ÓÊý¾Ý¿âÒÔ¼°javaÖе÷ÓÃÔ¶³Ì·½·¨¡£
Ê×ÏÈÊÇSocketµÄʹÓ㬶ÔÓÚ·þÎñ¶ËÀ´Ëµ£¬Ó¦¸ÃÉùÃ÷µÄÊÇServerSocket¶ÔÏó£¬È»ºóʹÓÃSocket
accept()·½·¨½øÐÐ ......