½âÎöJavaÀàºÍ¶ÔÏóµÄ³õʼ»¯¹ý³Ì
ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬¶Ô JVM Ö´Ðйý³ÌµÄ¹Ø¼üµã½øÐÐÈ«Ãæ½âÎö£¬²¢ÔÚÎÄÖд©²åÈëÁËÏà¹Ø JVM ¹æ·¶ºÍ JVM µÄ²¿·ÖÄÚ²¿ÀíÂÛ֪ʶ£¬ÒÔÀíÂÛÓëʵ¼Ê½áºÏµÄ·½Ê½½éÉܶÔÏó³õʼ»¯ºÍÀà³õʼ»¯Ö®¼äµÄÐ×÷ÒÔ¼°¿ÉÄÜ´æÔڵijåÍ»ÎÊÌâ¡£
ÎÊÌâÒýÈë
½üÈÕÎÒÔÚµ÷ÊÔÒ»¸öö¾ÙÀàÐ͵ĽâÎöÆ÷³ÌÐò£¬¸Ã½âÎöÆ÷Êǽ«Êý¾Ý¿âÄÚÒ»Íò¶àÌõö¾Ù´úÂë×°Ôص½»º´æÖУ¬ÎªÁËʵÏÖ¿ìËÙ¶¨Î»Ã¶¾Ù´úÂëºÍ¾ßÌåö¾ÙÀà±ðµÄËùÓÐö¾ÙÔªËØ£¬¸ÃÀàÔÚ×°ÔØö¾Ù´úÂëµÄͬʱ¶ÔÆä²ÉÈ¡Á½ÖÖ²ßÂÔ½¨Á¢ÄÚ´æË÷Òý¡£ÓÉÓÚ¸ÃÀàÊÇÒ»¸ö¹«¹²·þÎñÀ࣬ÔÚ³ÌÐò¸÷¸ö²ãÃ涼»áʹÓõ½Ëü£¬Òò´ËÎÒ½«ËüʵÏÖΪһ¸öµ¥ÀýÀà¡£Õâ¸öÀàÔÚÎÒµ÷ÕûÀàʵÀý»¯Óï¾äλÖÃ֮ǰÔËÐÐÕý³££¬µ«µ±ÎҰѸÃÀàʵÀý»¯Óï¾äµ÷Õûµ½¾²Ì¬³õʼ»¯Óï¾ä֮ǰʱ£¬ÎҵijÌÐò²»ÔÙΪÎÒ¹¤×÷ÁË¡£ ÏÂÃæÊǾ¹ýÎÒ¼ò»¯ºóµÄʾÀý´úÂ룺
£ÛÇåµ¥Ò»£Ý
package com.ccb.framework.enums;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class CachingEnumResolver {
//µ¥Ì¬ÊµÀý Ò»ÇÐÎÊÌâ½ÔÓÉ´ËÐÐÒýÆð
private static final CachingEnumResolver SINGLE_ENUM_RESOLVER = new CachingEnumResolver();
/*MSGCODE->CategoryÄÚ´æË÷Òý*/
private static Map CODE_MAP_CACHE;
static {
CODE_MAP_CACHE = new HashMap();
//ΪÁË˵Ã÷ÎÊÌâ,ÎÒÔÚÕâÀï³õʼ»¯Ò»ÌõÊý¾Ý
CODE_MAP_CACHE.put("0","±±¾©ÊÐ");
}
//private, for single instance
private CachingEnumResolver() {
//³õʼ»¯¼ÓÔØÊý¾Ý ÒýÆðÎÊÌ⣬¸Ã·½·¨Ò²Òª¸ºµãÔðÈÎ
initEnums();
}
/** * ³õʼ»¯ËùÓеÄö¾ÙÀàÐÍ */
public static void initEnums() {
// ~~~~~~~~~ÎÊÌâ´ÓÕâÀ↑ʼ±©Â¶ ~~~~~~~~~~~//
if (null == CODE_MAP_CACHE) {
System.out.println("CODE_MAP_CACHEΪ¿Õ,ÎÊÌâÔÚÕâÀ↑ʼ±©Â¶.");
CODE_MAP_CACHE = new HashMap();
}
CODE_MAP_CACHE.put("1", "±±¾©ÊÐ");
CODE_MAP_CACHE.put("2", "ÔÆÄÏÊ¡");
//..... other code...
}
public Map getCache() {
return Collections.unmodifiableMap(CODE_MAP_CACHE);
}
/** * »ñÈ¡µ¥Ì¬ÊµÀý * * @re
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
Ò»£º×¼±¸ www.savarese.org download
1. rocksaw-1.0.0-src.tar.gz
2. vserv-tcpip-0.9.2-src.tar.gz
¶þ£º±àÒëÔ´ÎļþµÃµ½jar°ü ʹÓÃAnt
1. build vserv-tcpip-0.9.2-src
ÔÚvserv-tcpip-0.9.2Ŀ¼ÏÂÃ潨һ¸ötestsĿ¼£¬È»ºóÔÚcmd´°¿ÚϽøÈë ......
ºÜ¾ÃûÓп´JAVAÁË£¬Ëæ±ãÕÒÁ˼¸¸öÌ⣬ÒѾ¶¼Íü¼ÇÁË¡£
£¨1£©JAVAºÍJAVAC ÃüÁîÐÐ
javac
-classpath£¬É趨ҪËÑË÷ÀàµÄ·¾¶£¬¿ÉÒÔÊÇĿ¼£¬jarÎļþ£¬zipÎļþ£¨ÀïÃ涼ÊÇclassÎļþ£©£¬»á¸²¸ÇµôËùÓÐÔÚCLASSPATHÀïÃæµÄÉ趨¡£
-sourcepath£¬ É趨ҪËÑË÷±àÒëËùÐèjava ÎļþµÄ·¾¶£¬¿ÉÒÔÊÇĿ¼£¬jarÎļþ£¬zipÎļþ£¨ÀïÃ涼ÊÇjavaÎļþ£© ......
package Demo;
// Java·ºÐÍ·½·¨
class Demo26 {
public <T> T fun(T t) { // ¿ÉÒÔ½ÓÊÕÈÎÒâÀàÐ͵ÄÊý¾Ý
return t; // Ö±½Ó°Ñ²ÎÊý·µ»Ø
}
}
public class GenericsDemo26 {
public static void main(String args[]) {
Demo26 d = new Demo26(); // ʵÀý»¯Demo¶ÔÏó
String str = d.fun("it"); // ´«µÝ× ......