java×Ö·û´®Ïêϸ·ÖÎö
²»¿É±äString
String¶ÔÏóÊDz»¿É±äµÄ£¬²é¿´JDKÎĵµÄã»á·¢ÏÖ£¬StringÀàÖÐÿһ¸ö¿´ÆðÀ´»áÐÞ¸ÄStringÖµµÄ·½·¨£¬Êµ¼ÊÉ϶¼ÊÇ´´½¨ÁËÒ»¸öȫеÄString¶ÔÏó£¬
ÒÔ°üº¬Ð޸ĺóµÄ×Ö·û´®ÄÚÈÝ¡£¶ø×î³õµÄString¶ÔÏóÔòË¿ºÁδ¶¯¡£
public class trys {
public static String upcase(String s){
return s.toUpperCase();
}
public static void main(String[] args) {
String q="howdy";
System.out.println(q);
String qq=upcase(q);
System.out.println(qq);
System.out.println(q);
}
}
µ±°Ñq´«¸øupcase()ʱ£¬Êµ¼Ê´«µÝµÄÊÇÒýÓõÄÒ»¸ö¿½±´£¬Æäʵ£¬Ã¿µ±°ÑString¶ÔÏó×÷Ϊ·½·¨µÄ²ÎÊýʱ£¬¶¼»á¸´ÖÆÒ»·ÝÒýÓ㬶ø¸ÃÒýÓÃËùÖ¸ÏòµÄ¶ÔÏóÆäʵһֱ´ýÔÚµ¥Ò»µÄÎïÀí
λÖÃÉÏ£¬´Óδ¶¯¹ý¡£
»Øµ½upcase()·½·¨Ê±£¬´«ÈëÆäÖеÄÒýÓÃÓÐÁËÃû×Ös,Ö»ÓÐupcase()ÔËÐÐʱ£¬¾Ö²¿ÒýÓÃs²Å´æÔÚ£¬Ò»µ©upcase()ÔËÐнáÊø£¬s¾ÍÏûʧÁË£¬µ±È»ÁË£¬upcase()µÄ·µ»ØÖµ£¬Æäʵֻ
ÊÇ×îÖÕ½á¹ûµÄÒýÓã¬Õâ×ãÒÔ˵Ã÷£¬upcase()·µ»ØµÄÒýÓÃÒѾָÏòÁËÒ»¸öеĶÔÏ󣬶øÔ±¾µÄq»¹ÊÇÔÚԵء£
StringµÄÕâÖÖÐÐΪ·½Ê½ÆäʵÕýÊÇÎÒÃÇÏëÒªµÄ¡£ÀýÈ磺
String s="asdf";
String x=Immutable.upcase(s);
ÄѵÀÄãÕæµÄÏ£Íûupdate()¸Ä±äÆä²ÎÊýÂ𣿶ÔÓÚÒ»¸ö·½·¨¶øÑÔ£¬²ÎÊýÊÇΪÁËΪ¸Ã·½·¨ÌṩÐÅÏ¢£¬¶ø²»ÊÇÏëÈø÷½·¨¸Ä±ä×Ô¼ºµÄ£¬ÔÚÔĶÁÕâ¶Î´úÂëʱ£¬¶ÁÕß×ÔÈ»¾Í»áÓÐÕâÑùµÄ¸Ð¾õ£¬
ÕâµãºÜÖØÒª£¬ÕýÊÇÓÐÁËÕâÖÖ±£ÕÏ£¬²ÅʹµÃ´úÂëÒ×ÓÚ±àдÓëÔĶÁ¡£
ÖØÔØ“+”ÓëStringBuilder
String¶ÔÏóʱ²»¿É±äµÄ£¬Äã¿ÉÒÔ¸øÒ»¸öString¶ÔÏó¼ÓÈÎÒâ¶àµÄ±ðÃû£¬ÒòΪString¶ÔÏó¾ßÓÐÖ»¶ÁÊôÐÔ£¬ËùÒÔÖ¸ÏòËûµÄÈκÎÒýÓö¼²»¿ÉÄܸıäËüµÄÖµ£¬Òò´Ë£¬Ò²¾Í²»»á¶ÔÆäËûµÄ
ÓÐʲôӰÏì¡£
²»¿É±äÐÔ»á´øÀ´Ò»¶¨µÄЧÂÊÎÊÌ⣬ΪString¶ÔÏóÖØÔØ"+"²Ù×÷·û¾ÍÊÇÒ»¸öÀý×Ó¡£ÖØÔزÙ×÷·ûµÄÒâ˼ÊÇ£¬Ò»¸ö²Ù×÷·ûÔÚÓ¦ÓÃÓÚÌض¨µÄÀàʱ£¬±»¸³ÓèÌØÊâµÄÒâÒå(ÓÃÓÚ
StringµÄ"+"Óë"+="ÊÇJavaÖнöÓеÄÁ½¸öÖØÔعýµÄ²Ù×÷·û£¬¶øJava²»ÔÊÐí³ÌÐòÔ±ÖØÔØÈκβÙ×÷·û)¡£
public class Concatenation{
public static void main(String[] args){
String mango="mango";
String s="abc"+mango+"def"+47;
System.out.println(s);
}
}
//¼Çס "abc"ÊôÓÚchar[]ÀàÐÍ ¶ø²»ÊÇÊôÓÚStringÀàÐÍ£¬ÒòΪStringÊÇÀà¡£
¿ÉÒÔÏëÏóһϣ¬Õâ¶Î´úÂ
Ïà¹ØÎĵµ£º
jarÎļþÌý˵¹ýÂð£¬Ã»ÓУ¿»òÕßÄ°Éú£¡ºÃ£¬Ã»¹Øϵ£¬Õâ¾ÍÊÇÎÒÃǵĵÚÒ»Õ¾£º´ò°ü·¢²¼¡£
Ϊʲô»áÓÐÕâ¸öÍæÒâÄØ£¬Ê×ÏÈ£¬ÕâÊÇjarµÄÈ«³Æ£ºJavaTM Archive (JAR) file£¬Êǵģ¬¾ÍÊÇjava´æµµÎļþ¡£ÕâÓеãÀàËÆzipÎļþ£¬ÏëÒ»ÏëËüÊǸÉʲôµÄÓõÄÄØ£¬Ñ¹Ëõ£¡£¿Ã»´í¾ÍÊÇҪѹËõ£¬½«ÎÒÃÇÔÏÈÁãÉ¢µÄ¶«Î÷·Åµ½Ò»Ï£¬ÖØР×éÖ¯£¬ËùÓÐÕâЩĿµÄÖ»ÓÐÒ»¸ ......
Ò»¡¢µ÷ÓÃÊôÐÔÎļþÊôÐԵĴúÂ룺
String url=SmsProperties.get("sms_address_frontend");//È¡µØÖ·Èç“sms_address_frontend=http://172.16.1.9:8280/sms_frontend/services/smsSenderWebService”
String smsServer = SmsProperties.get("sms_server_name");//·¢ËͶÌÐŵķþÎñÕ˺Å(ÕâÀï¿ÉÒÔÈ¡ÖÐÎÄÊôÐ ......
來Ô´£ºhttp://www.infoq.com/cn/articles/memcached-java
×÷Õß
á¯Îijõ
·¢²¼ÓÚ
2008Äê9ÔÂ27ÈÕ ÉÏÎç12ʱ38·Ö
ÉçÇø
Java
Ö÷Ìâ
¼¯ÈºÓ뻺´æ
Memcached ÊÇʲô£¿
MemcachedÊÇÒ»ÖÖ¼¯ÖÐʽCache£¬Ö§³Ö·Ö²¼Ê½ºáÏòÀ©Õ¹¡£ÕâÀïÐèÒª½âÊÍ˵Ã÷һϣ¬ºÜ¶à¿ª·¢Õß¾õµÃMemcachedÊÇÒ»ÖÖ· ......
public class ExcelUtil {
/*
* ¸ù¾ÝExcelÎļþ·¾¶ºÍ±íµ¥Ãû³Æ£¬Ò»´Î²éÕÒ´Ë±íµ¥µÄËùÓмǼ*/
public static String[][] getContentByName(String sourcePath,String sheetName){
String[][] strArray = null;
try {
InputStream is = new FileInputStream(sourcePath);
Workbook wb = Workbook.get ......
package com.mapabc.sz_hbt.util;
/**
* <p>Title:ÕûÐÍÓ볤¶ÈΪ4µÄ×Ö½ÚÊý×éµÄ»¥»» </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2007-5-10</p>
* <p>Company: www.mapabc.com</p>
* @author luoyj
* @version 1.0
*/
public class Byte ......