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
Ïà¹ØÎĵµ£º
תÔØ£º
±¾ÎÄÀ´×Ô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 ......
Ò»¡¢¶àÖÖ·½Ê½¶ÁÎļþÄÚÈÝ¡£
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 ......
<%
//header.jsp
out.println("Protocol: " + request.getProtocol() + "<br>");
out.println("Scheme: " + request.getScheme() + "<br>");
out.println("Server Name: " + request.getServerName() + "<br>" );
out.println(&quo ......
1.Listת»»³ÉΪÊý×é¡££¨ÕâÀïµÄListÊÇʵÌåÊÇArrayList)
¡¡¡¡µ÷ÓÃArrayListµÄtoArray·½·¨¡£
¡¡¡¡toArray
¡¡¡¡public <T> T[] toArray(T[] a)·µ»ØÒ»¸ö°´ÕÕÕýÈ·µÄ˳Ðò°üº¬´ËÁбíÖÐËùÓÐÔªËصÄÊý×飻·µ»ØÊý×éµÄÔËÐÐʱÀàÐ;ÍÊÇÖ¸¶¨Êý×éµÄÔËÐÐʱÀàÐÍ¡£Èç¹ûÁбíÄÜ·ÅÈëÖ¸¶¨µÄÊý×飬Ôò·µ»Ø·ÅÈë´ËÁбíÔªËصÄÊý×é¡£·ñÔò£¬½«¸ù¾ ......
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 ......