java¼¯ºÏ¿ò¼Üͼ¼°½éÉÜ
ת×Ô:http://hi.baidu.com/%C9%AE_%CC%C6/blog/item/9e2a8b0887008a8ad0581b3d.html
¼ò»¯Í¼£º
Javaƽ̨ÌṩÁËÒ»¸öȫеļ¯ºÏ¿ò¼Ü¡£“¼¯ºÏ¿ò¼Ü”Ö÷ÒªÓÉÒ»×éÓÃÀ´²Ù×÷¶ÔÏóµÄ½Ó¿Ú×é³É¡£²»Í¬½Ó¿ÚÃèÊöÒ»×鲻ͬÊý¾ÝÀàÐÍ¡£
Java 2¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú£º6¸ö½Ó¿Ú£¨¶ÌÐéÏß±íʾ£©£¬±íʾ²»Í¬¼¯ºÏÀàÐÍ£¬ÊǼ¯ºÏ¿ò¼ÜµÄ»ù´¡¡£
³éÏóÀࣺ5¸ö³éÏóÀࣨ³¤ÐéÏß±íʾ£©£¬¶Ô¼¯ºÏ½Ó¿ÚµÄ²¿·ÖʵÏÖ¡£¿ÉÀ©Õ¹Îª×Ô¶¨Ò弯ºÏÀà¡£
ʵÏÖÀࣺ8¸öʵÏÖÀࣨʵÏß±íʾ£©£¬¶Ô½Ó¿ÚµÄ¾ßÌåʵÏÖ¡£
Ôںܴó³Ì¶ÈÉÏ£¬Ò»µ©ÄúÀí½âÁ˽ӿڣ¬Äú¾ÍÀí½âÁË¿ò¼Ü¡£ËäÈ»Äú×ÜÒª´´½¨½Ó¿ÚÌض¨µÄʵÏÖ£¬µ«·ÃÎÊʵ¼Ê¼¯ºÏµÄ·½·¨Ó¦¸ÃÏÞÖÆÔÚ½Ó¿Ú·½·¨µÄʹÓÃÉÏ£»Òò´Ë£¬ÔÊÐíÄú¸ü¸Ä»ù±¾µÄÊý¾Ý½á¹¹¶ø²»±Ø¸Ä±äÆäËü´úÂë¡£
· Collection ½Ó¿ÚÊÇÒ»×éÔÊÐíÖظ´µÄ¶ÔÏó¡£
· Set ½Ó¿Ú¼Ì³Ð Collection£¬µ«²»ÔÊÐíÖظ´£¬Ê¹ÓÃ×Ô¼ºÄÚ²¿µÄÒ»¸öÅÅÁлúÖÆ¡£
· List ½Ó¿Ú¼Ì³Ð Collection£¬ÔÊÐíÖظ´£¬ÒÔÔªËØ°²²åµÄ´ÎÐòÀ´·ÅÖÃÔªËØ£¬²»»áÖØÐÂÅÅÁС£
· Map½Ó¿ÚÊÇÒ»×é³É¶ÔµÄ¼ü£Öµ¶ÔÏ󣬼´Ëù³ÖÓеÄÊÇkey-value pairs¡£MapÖв»ÄÜÓÐÖظ´µÄkey¡£ÓµÓÐ×Ô¼ºµÄÄÚ²¿ÅÅÁлúÖÆ¡£
· ÈÝÆ÷ÖеÄÔªËØÀàÐͶ¼ÎªObject¡£´ÓÈÝÆ÷È¡µÃÔªËØʱ£¬±ØÐë°ÑËüת»»³ÉÔÀ´µÄÀàÐÍ¡£
Java 2¼ò»¯¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú
1.Collection ½Ó¿Ú
ÓÃÓÚ±íʾÈκζÔÏó»òÔªËØ×é¡£ÏëÒª¾¡¿ÉÄÜÒÔ³£¹æ·½Ê½´¦ÀíÒ»×éÔªËØʱ£¬¾ÍʹÓÃÕâÒ»½Ó¿Ú¡£
(1) µ¥ÔªËØÌí¼Ó¡¢É¾³ý²Ù×÷£º
boolean add(Object o):½«¶ÔÏóÌí¼Ó¸ø¼¯ºÏ
boolean remove(Object o): Èç¹û¼¯ºÏÖÐÓÐÓëoÏàÆ¥ÅäµÄ¶ÔÏó£¬Ôòɾ³ý¶ÔÏóo
(2) ²éѯ²Ù×÷£º
int size() £º·µ»Øµ±Ç°¼¯ºÏÖÐÔªËصÄÊýÁ¿
boolean isEmpty() £ºÅжϼ¯ºÏÖÐÊÇ·ñÓÐÈκÎÔªËØ
boolean contains(Object o) £º²éÕÒ¼¯ºÏÖÐÊÇ·ñº¬ÓжÔÏóo
Iterator iterator() £º·µ»ØÒ»¸öµü´úÆ÷£¬ÓÃÀ´·ÃÎʼ¯ºÏÖеĸ÷¸öÔªËØ
(3) ×é²Ù×÷ £º×÷ÓÃÓÚÔªËØ×é»òÕû¸ö¼¯ºÏ
boolean containsAll(Collection c): ²éÕÒ¼¯ºÏÖÐÊÇ·ñº¬Óм¯ºÏc ÖÐËùÓÐÔªËØ
boolean addAll(Collection c) : ½«¼¯ºÏc ÖÐËùÓÐÔªËØÌí¼Ó¸ø¸Ã¼¯ºÏ
void clear(): ɾ³ý¼¯ºÏÖÐËùÓÐÔªËØ
void removeAll(Collection c) : ´Ó¼¯ºÏÖÐɾ³ý¼¯ºÏc ÖеÄËùÓÐÔªËØ
void retainAll(Collection c) : ´Ó¼¯ºÏÖÐɾ³ý¼¯ºÏc Öв»°üº¬µÄÔªËØ
(4) Collectionת»»ÎªObjectÊý×é £º
Object[] toArray() £º·µ»ØÒ»¸öÄÚº¬¼¯ºÏËùÓÐÔªËصÄarray
Object[] toArray(Object[] a) £º·µ»ØÒ»¸öÄÚº¬¼¯ºÏËùÓÐÔªËصÄarr
Ïà¹ØÎĵµ£º
Ò»£º RSS½éÉÜ
¸ù¾Ýά»ù°Ù¿Æ(http://zh.wikipedia.org/wiki/RSS)µÄ¶¨Ò壬“RSSÊÇÒ»ÖÖÓÃÓÚ¹²ÏíÐÂÎźÍÆäËûWebÄÚÈݵÄÊý¾Ý½»»»¹æ·¶ ”£¬ËüÊÇһϵÁеĹ淶µÄ×éºÏ£¬²ÉÓÃXML¸ñʽ¡£Ä¿Ç°¹úÄÚRSSÓ¦ÓÃ×î¶àµÄÊÇÔÚÐÂÎÅÍøÕ¾ºÍ²©¿ÍÍøÕ¾ÉÏ¡£
Ðí¶àÍøÕ¾¿ÉÒÔÓÃRSSÔĶÁÆ÷À´¸öÐÔ»¯×Ô¼ºµÄÍøÒ³£¬±ÈÈçÏÔʾ×îеÄÐÂÀËÐÂÎÅ£¬ÏÔʾ×Ô¼ººÃÅóÓÑ ......
Ò»£® InputºÍOutput
1. stream´ú±íµÄÊÇÈκÎÓÐÄÜÁ¦²ú³öÊý¾ÝµÄÊý¾ÝÔ´£¬»òÊÇÈκÎÓÐÄÜÁ¦½ÓÊÕÊý¾ÝµÄ½ÓÊÕÔ´¡£ÔÚJavaµÄIOÖУ¬ËùÓеÄstream£¨°üÀ¨InputºÍOut stream£©¶¼°üÀ¨Á½ÖÖÀàÐÍ£º
1.1 ÒÔ×Ö½ÚΪµ¼ÏòµÄstream
ÒÔ×Ö½ÚΪµ¼ÏòµÄstream£¬±íʾÒÔ×Ö½ÚΪµ¥Î»´ÓstreamÖжÁÈ¡»òÍùstreamÖÐдÈëÐÅÏ¢¡£ÒÔ×Ö½ÚΪµ¼ÏòµÄstream°üÀ¨ÏÂÃæ¼¸Ö ......
2009-08-19
תÔØ £º http://yahaitt.javaeye.com/blog/453032
java Adapterģʽ
¹Ø¼ü×Ö: android adapter
ͨ³££¬¿Í»§Àࣨclients of class£©Í¨¹ýÀàµÄ½Ó¿Ú·ÃÎÊËüÌṩµÄ·þÎñ¡£ÓÐʱ£¬ÏÖÓеÄÀࣨexisting class£©¿ÉÒÔÌṩ¿Í»§ÀàµÄ¹¦ÄÜÐèÒª£¬µ«ÊÇËüËùÌṩµÄ½Ó¿Ú²»Ò»¶¨ÊÇ¿Í»§ÀàËùÆÚÍûµÄ¡£ÕâÊÇÓÉÓÚÏÖÓеĽӿÚÌ«Ïêϸ»òÕßȱ·¦ ......
//Îå¸öÀà
--|fileÀֱࣺ½ÓÓëÎļþ±¾ÉíÓйØϵ
--|×Ö½ÚÁ÷ OutputStream InputStream
--|×Ö·ûÁ÷ Writer Reader
´æ·ÅÔÚÎļþÖеĶ¼ÊÇ×Ö½Ú¡£¶ø¶Áµ½ÄÚ´æÖвſÉÄܱä³É×Ö·û
´òÓ¡Á÷£ºprintStream/PrintWriter:ÌṩÁ˸÷ÖÖ´òÓ¡¹¦ÄÜ£¬¿ÉÒÔÊä³öÈÎÒâµÄÄÚÈÝ£¬¸ù¾ÝʵÀý»¯¶ÔÏóµÄ²»Í¬
Êä³öµÄλÖÃÒ²²»Í¬
package java11.I ......
/**
* µÃµ½±¾ÖÜÖÜÒ»
*
* @return yyyy-MM-dd
*/
public static String getMondayOfThisWeek() {
Calendar c = Calendar.getInstance();
int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
if (day_of_week == 0)
da ......