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");
operate(a,b);
System.out.println(a+","+b);
}
}
Êä³öAB , B
JAVA·½·¨µ÷ÓÃÊÇͨ¹ý“´«Öµ”£¬¶ÔÓÚÔÐÍÀ´Ëµ£¬ÊǰÑÖµcopy¹ýÈ¥£¬Óëµ÷ÓÃÕ߾Ͳ»Ïà¸ÉÁË¡£µ«ÊǶÔÓÚÒýÓÃÀ´Ëµ£¬Ö»ÊÇÒâζ×ŰÑÄÚ´æµØÖ·´«¹ýÈ¥£¬ÀïÃæ´æ·ÅµÄ“ÄÚÈÝ”¸úµ÷ÓÃÕßÊÇͬһ¸ö£¡Ò²¼´ËµÐÞ¸ÄÄÚÈÝ»áÓ°Ïìµ÷ÓÃÕß
x.append(y);//»áʹa±ä³ÉAB,
µ«ÊÇ
y = x ;//Ö»ÊÇʹ“Õâ¸ö”·½·¨ÄÚµÄÁÙʱ±äÁ¿yÖ¸Ïòx,¶ø²»»áÓ°Ïì´Ë·½·¨ÍâµÄµ÷ÓÃÕßµÄÒýÓã¬
ËùÒÔb»¹ÊǺ¬B
Ïà¹ØÎĵµ£º
(1)Õ»
package ChapterOne;
public class Stack {
//Õ»Êý×é
long stackArr[];
//Õ»µÄ´óС
int maxSize;
//Õ»µÄ¶¥²¿
int top;
//³õʼ»¯Ò»¸ö´óСΪsizeµÄÕ»
public Stack(int size){
maxSize = size;
stackArr = new long[size];
top = -1;
}
//³öÕ»²Ù×÷
public long pop(){
return sta ......
½ñÌìÓöµ½Ò»¸öÒªÉú³ÉÒ»¸öÏÂÀÁбí¿òµÄÎÊÌ⣬ÎÒµÄÏë·¨ÊÇ£º½«Êý¾Ý¿âÄÚµÄËùÓÐÊý¾Ý¶¼´æ´¢µ½Ò»¸öListÀïÃæ£¬ÔÙÔÚǰ̨±éÀúÕû¸ölist¡£
Ö´ÐÐЧ¹ûͼ£º
Ë®¹û
→Æ»¹û
→→Æ»¹ûϵÁÐ1
→→Æ»¹ûϵÁÐ2
→→Æ»¹ûϵÁÐ3
→→Æ»¹ûϵÁÐ4
→Àæ
→ÌÒ×Ó
ѧϰÓÃÆ·
→±Ê
→→Ǧ±Ê ......
/*
* @(#)ObjectPoolManager.java 1.00 2005-5-1
*
* Copyright 2005 BeanSoft Studio. All rights reserved.
* PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package  ......
Apache MINA (mina-2.0.0-M6Ô´ÂëΪÀý):
ÎÒÃÇʹÓÃmina nio tcp×î³£ÓõÄÑùÀýÈçÏÂ:
NioSocketAcceptor acceptor = new NioSocketAcceptor(/*NioProcessorPool's size*/);
DefaultIoFilterChainBuilder cha ......
1.Listת»»³ÉΪÊý×é¡££¨ÕâÀïµÄListÊÇʵÌåÊÇArrayList)
¡¡¡¡µ÷ÓÃArrayListµÄtoArray·½·¨¡£
¡¡¡¡toArray
¡¡¡¡public <T> T[] toArray(T[] a)·µ»ØÒ»¸ö°´ÕÕÕýÈ·µÄ˳Ðò°üº¬´ËÁбíÖÐËùÓÐÔªËØµÄÊý×飻·µ»ØÊý×éµÄÔËÐÐʱÀàÐ;ÍÊÇÖ¸¶¨Êý×éµÄÔËÐÐʱÀàÐÍ¡£Èç¹ûÁбíÄÜ·ÅÈëÖ¸¶¨µÄÊý×飬Ôò·µ»Ø·ÅÈë´ËÁбíÔªËØµÄÊý×é¡£·ñÔò£¬½«¸ù¾ ......