JavaÖеÄÖÐÎÄÅÅÐò£¨¼ò¶Ì°æ£©
ÔÚJavaÖУ¬Èç¹ûÔÚ¶ÔÒ»¸öList»òÕßMapÅÅÐò£¬¿ÉÒÔ²ÉÓÃCollectionsµÄ¼¯ºÏÀàÖеÄsort·½·¨À´¶ÔList½øÐÐÅÅÐò¡£ÖÁÓÚmap£¬¿ÉÒÔʹÓÃTreeMap×Ô¶¯ÅÅÐò¡£
µ«ÒÔÉÏÅÅÐò½ö½öÊǶÔÓ¢ÎÄÅÅÐòʱ£¬²Å»áÕýÈ·£¬Èô¹ûÊý¾ÝÀïÃæ´æÔÚÖÐÎĺÍÓ¢ÎÄʱ£¬ÄÇôÅÅÐò¾ÍÂÒÁË¡£
ÏÖÔÚÎÒʵÏֵķ½·¨ÊÇ°´ÕÕÖÐÎĵÄÆ´ÒôÀ´ÅÅÐò¡££¨ÍøÉÏ£¬»¹Óа´±Ê»ÅÅÐò£¬ÔÚÕâÀïÎҾͲ»Ò»Ò»ÊµÏÖÁË£©
ÈçÏÂÊǶÔMap£¬ÔÚн¨¶ÔÏóʱ£¬¸ømapʵÏÖcomparator½Ó¿Ú¡£
//ΪTreeMapÔö¼ÓÖÐÎÄÅÅÐò
userItems = new TreeMap(new Comparator(){
Collator collator = Collator.getInstance();
public int compare(Object o1, Object o2) {
CollationKey key1 = collator.getCollationKey(o1.toString());
CollationKey key2 = collator.getCollationKey(o2.toString());
return key1.compareTo(key2);
}
});
ͬÑùµÀÀí£¬ÈçÏÂÊǶÔList
ͬÑùҲʹÓÃÁËCollectionsµÄ¼¯ºÏÀàÖеÄsort·½·¨À´¶ÔList½øÐÐÅÅÐò,µ«ÊÇÖØдÁËcomparatorµÄʵÏÖ·½·¨¡£
//ÖÐÎÄÅÅÐò£¬°´»ú¹¹µÄÃû³Æ¡£
Collections.sort(templist, new Comparator(){
Collator collator = Collator.getInstance();
public int compare(Object o1, Object o2) {
TreeBFOEx org1 = (TreeBFOEx)o1;
TreeBFOEx org2 = (TreeBFOEx)o2;
CollationKey key1 = collator.getCollationKey(org1.getDescription());
CollationKey key2 = collator.getCollationKey(org2.getDescription());
return key1.compareTo(key2);
}
});
Ïà¹ØÎĵµ£º
Ò»¡¢Spring»ù´¡ÖªÊ¶¼°IOC_Ñ¡ÔñÌâ
1. ÏÂÃæ¹ØÓÚspringÃèÊö´íÎóµÄÊÇ£º£¨ £©
A SpringÖ§³Ö¿É²åÈëµÄÊÂÎñ¹ÜÀíÆ÷£¬Ê¹ÊÂÎñ»®·Ö¸üÇáËÉ£¬Í¬Ê±ÎÞÐè´¦Àíµ×²ãµÄÎÊÌâ¡£
B SpringÊÂÎñ¹ÜÀíµÄͨÓóéÏó²ã»¹°üÀ¨JTA²ßÂÔºÍÒ»¸öJDBC DataSource¡£
C ÓëJTA»òEJB CMTÒ»Ñù£¬SpringµÄÊÂÎñÖ§³ÖÒÀÀµÓÚJava EE»·¾³¡£
D Spr ......
£¨´ËÌù½÷Ïò£¬²ËÄñ¼¶JAVA³ÌÐòÔ±Ìṩ±ãÀû£¬ºÇºÇ£¬£¬ÈôÓÐÐÒ¸ßÊÖ³öÏÖ£¬»¹Íû¶à¶àÖ¸µã¡£Ð¡µÜÉõ»¶£¡£©
×î½üæÓÚ¿ª·¢Ò»Ì×¼à¿Øϵͳ¡£
ÐèÒª±¨¾¯ÉùÒô¡£
ÔÚÑ°Çó½â¾ö·½°¸µÄʱºò£¬³öÏÖÁ½ÖÖ·½°¸¡£
Ò»¡¢ÓÃjavax.sound.sampled.*°ü£¬½øÐÐÉùÒô´¦Àí¡£
¶þ¡¢ÓÃsun.audio.AudioPlayer°ü£¬½øÐÐÉùÒô´¦Àí¡£
µÚÒ»ÖÖ·½°¸ÓÃÆðÀ´£¬»á¾³£ÐÔ³öÏÖ¿¨Ö ......
JavaÖÐÒì³£Ò»°ã·ÖΪ3À࣬ϱ߽éÉÜÏ£¬½ö½öÊǸöÈËÀí½â¡£
µÚÒ»ÖÖÊDZàÒëÆÚÒì³££¬»òÕß½Ðcheck Exception¡£
±àÒëÆÚÒì³£µÄÌص㣺
1.ϵͳҪÇó±ØÐëÔÚ³ÌÐòÀï×ö³ö´¦Àí£¬·ñÔò±¨±àÒë´íÎ󣬱àÒëÎÞ·¨Í¨¹ý£¬Ò²¾ÍÊÇ˵ϵͳǿÖÆÒªÇó´¦Àí£¬¶ÔÓÚ´¦Àí·½Ê½£¬²»ÍâºõÖ±½Ócatch´¦ÀíºÍÅ׳öµ½Íâ²ã£¬µ«ÊÇ×îÖÕ»¹ÊÇÒª´¦ÀíµÄ¡£
2.Óû§×Ô¶¨ÒåÒ»¸ö±àÒëÆÚÒ ......
1¡¢ Java¶ÔÏó¸³Öµ
Java´úÂë
Employee e1=
new
Employee(
"Àî"
);
//EmployeeÊÇÒ»¸ö×Ô¶¨ÒåÀà
Employee e2=e1; //¸³Öµ¶ÔÏó
e2.setName("Íõ"
);
//¸Ä±ä¶ÔÏóe2µÄÃû×Ö
System.out.println(e1.getName ......
JAVAÖеĴ«µÝ¶¼ÊÇÖµ´«µÝÂð£¿ÓÐûÓÐÒýÓô«µÝÄØ£¿
ÔڻشðÕâÁ½¸öÎÊÌâÇ°£¬ÈÃÎÒÃÇÊ×ÏÈÀ´¿´Ò»¶Î´úÂ룺
Java´úÂë
public class ParamTest {
// ³õʼֵΪ0
protected int num = 0;
// Ϊ·½·¨²ÎÊýÖØи³Öµ
public void change(int i) {
i = 5;
}
// Ϊ·½·¨²ÎÊýÖØи³Öµ
public void change(ParamTest t) {
P ......