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

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


Ïà¹ØÎĵµ£º

JavaÊý¾Ý½á¹¹ºÍËã·¨ Õ»Óë¶ÓÁÐ

(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 ......

javaµÝ¹éÉú³ÉÏÂÀ­Áбí¿ò

½ñÌìÓöµ½Ò»¸öÒªÉú³ÉÒ»¸öÏÂÀ­Áбí¿òµÄÎÊÌ⣬ÎÒµÄÏë·¨ÊÇ£º½«Êý¾Ý¿âÄÚµÄËùÓÐÊý¾Ý¶¼´æ´¢µ½Ò»¸öListÀïÃæ£¬ÔÙÔÚǰ̨±éÀúÕû¸ölist¡£
Ö´ÐÐЧ¹ûͼ£º
Ë®¹û
→Æ»¹û
→→Æ»¹ûϵÁÐ1
→→Æ»¹ûϵÁÐ2
→→Æ»¹ûϵÁÐ3
→→Æ»¹ûϵÁÐ4
→Àæ
→ÌÒ×Ó
ѧϰÓÃÆ·
→±Ê
→→Ǧ±Ê ......

javaʵÏÖ¶ÔÏó³Ø

/*
 * @(#)ObjectPoolManager.java 1.00 2005-5-1
 *
 * Copyright 2005 BeanSoft Studio. All rights reserved.
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package  ......

minaÖ®ÐÔÄÜȱÏݼ°bug,java¸ßÐÔÄÜÓÎÏ··þÎñÆ÷ºÎÔÚ?

Apache MINA (mina-2.0.0-M6Ô´ÂëΪÀý):
    ÎÒÃÇʹÓÃmina nio tcp×î³£ÓõÄÑùÀýÈçÏÂ:
        NioSocketAcceptor acceptor = new NioSocketAcceptor(/*NioProcessorPool's size*/);
        DefaultIoFilterChainBuilder cha ......

javaÖÐÊý×éÓëListÏ໥ת»»µÄ·½·¨

1.Listת»»³ÉΪÊý×é¡££¨ÕâÀïµÄListÊÇʵÌåÊÇArrayList)
¡¡¡¡µ÷ÓÃArrayListµÄtoArray·½·¨¡£
¡¡¡¡toArray
¡¡¡¡public <T> T[] toArray(T[] a)·µ»ØÒ»¸ö°´ÕÕÕýÈ·µÄ˳Ðò°üº¬´ËÁбíÖÐËùÓÐÔªËØµÄÊý×飻·µ»ØÊý×éµÄÔËÐÐʱÀàÐ;ÍÊÇÖ¸¶¨Êý×éµÄÔËÐÐʱÀàÐÍ¡£Èç¹ûÁбíÄÜ·ÅÈëÖ¸¶¨µÄÊý×飬Ôò·µ»Ø·ÅÈë´ËÁбíÔªËØµÄÊý×é¡£·ñÔò£¬½«¸ù¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ