Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 »ù±¾µÄio²Ù×÷

תÔØ£º
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/xuchanghao/archive/2009/01/16/3796276.aspx
Ò»¡¢¶àÖÖ·½Ê½¶ÁÎļþÄÚÈÝ¡£
1¡¢°´×Ö½Ú¶ÁÈ¡ÎļþÄÚÈÝ
2¡¢°´×Ö·û¶ÁÈ¡ÎļþÄÚÈÝ
3¡¢°´ÐжÁÈ¡ÎļþÄÚÈÝ
4¡¢Ëæ»ú¶ÁÈ¡ÎļþÄÚÈÝ
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputS ......

java IO²Ù×÷ (¶Áд¡¢×·¼Ó¡¢É¾³ý¡¢Òƶ¯¡¢¸´ÖƵÈ)


Ò»¡¢¶àÖÖ·½Ê½¶ÁÎļþÄÚÈÝ¡£
1¡¢°´×Ö½Ú¶ÁÈ¡ÎļþÄÚÈÝ
2¡¢°´×Ö·û¶ÁÈ¡ÎļþÄÚÈÝ
3¡¢°´ÐжÁÈ¡ÎļþÄÚÈÝ
4¡¢Ëæ»ú¶ÁÈ¡ÎļþÄÚÈÝ
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java ......

JSP/Java»ñÈ¡HTTP headerÐÅÏ¢(request)Àý×Ó

<%
//header.jsp
out.println("Protocol: " + request.getProtocol() + "<br>");
out.println("Scheme: " + request.getScheme() + "<br>");
out.println("Server Name: " + request.getServerName() + "<br>" );
out.println(&quo ......

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

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

JAVAÅжÏ×Ö·û´®ÊÇ·ñΪÊý×Ö

StringתCharacterÊý×飬ÓÃCharacterµÄisDigitºÍisLetterº¯ÊýÈ¥Åжϡ£
public static boolean isNumeric(String str) {
for (int i = str.length(); i = 0;) {
if (!Character.isDigit(str.charAt(i))) {
return false;
}
}
return true;
}
public static boolean isNumeric(String str) {
Pattern patt ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ