Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaÖеķºÐÍ

    1¡¢Java.utilµÄ¼¯ºÏÀàÖеÄÔªËرØÐëÊǶÔÏ󻯵ģ¬ËûÃDz»ÄÜÊÇ»ù±¾ÀàÐÍ¡£Èç²»ÄÜÉùÃ÷Set<char>»òList<int>¡£µ«¶ÔList<Integer>£¬¿ÉÒÔÍùÀïÃæ¼ÓintÐÍÊý¾Ý£¬Ëü»áÓÃJavaµÄautoboxing»úÖÆ×Ô¶¯×ª»»³ÉInteger¶ÔÏó¡£
    2¡¢²ÎÊý»¯ÀàÖеÄÀàÐͲÎÊý¿ÉÒÔÊÇÊý×éÀàÐÍ£¬ÈçMap<String[],int[]),×¢Òâint[]ÐÍÊÇÒ»¸ö¶ÔÏ󣬶ø²»ÊÇԭʼÀàÐÍ¡£
 
    3¡¢Èç¹û²»ÏëÓ÷ºÐ͹¦ÄÜ£¬¿ÉÒÔͨ¹ý´ø-source1.4±ê¼ÇÀ´±àÒ룻Ҳ¿ÉÒÔÔÚÉùÃ÷µÄÓò»ò·½·¨Ç°ÓÃ@SuppressWarings("unchecked")±ê×¢À´ºöÂÔ¡£
    4¡¢Ò»¸öList<Integer>ÊÇÒ»¸öCollection<Integer>£¬µ«²»ÊÇÒ»¸öList<Object>£¬·ñÔòList<Integer>¿ÉÒÔת»»³ÉList<Object>,ÄÇôת»»ºóʲôÀàÐ͵ÄÊý¾Ý¶¼¿ÉÒÔ¼Ó½øÈ¥£¬Ã»Óдﵽ±àÒëÆÚÀàÐÍ°²È«µÄÄ¿µÄ¡£¼´£ºÀà¿ÉÒÔÉÏתÐÍ£¬ÀàÐͲÎÊý²»ÄÜÉÏתÐÍ¡£
    5¡¢JavaÖÐÒýÈë·ºÐ͵ı¾ÖÊ£ºÎªÁËÌṩ±àÒëÆÚµÄÀàÐÍ°²È«¼ì²é£¬ÒÔÃâÀàÐͲ»°²È«µÄbug³öÏÖÔÚÔËÐÐÆÚ¡££¨×¢ÒâÕâÓëC++¼°C#ÖзºÐ͵ÄÄ¿µÄ²»Í¬£©
    6¡¢Ò»¸öList<T>ÉÏתÐͳÉListÊǺϷ¨µÄ£¬ÕâÊÇΪÁËÏòºó¼æÈÝ£¬µ«²»ÍƼöÕâÑù×ö¡£ÒòΪÉÏתÐͺó¿ÉÒÔÌí¼ÓÈÎÒâÀàÐ͵ÄÔªËØ£¬»áÔÚºóÃæÒýÈëbug¡£
   ×¢Ò⣺ÉÏתÐÍÊDZàÒëÆÚÐÐΪ£¬ÔÚÔËÐÐʱÔËÐеĻ¹ÊÇδתÐÍÇ°µÄÄǸöÀàÐÍ
    7¡¢²»ÄÜ´´½¨²ÎÊý»¯ÀàÐ͵ÄÊý×é¡£ÈçList<String>[] wordlists=new ArrayList<String>[10]£»±àÒëͨ²»¹ý¡£±àÒëÆ÷ΪʲôҪÕâÑù×öÄØ£¿ÈçÏ£º
List<String>[] wordlists=new ArrayList<String>[10]; //Èô¿ÉÒÔ´´½¨Êý×飬¼ÌÐøÍùÏÂÖ´ÐÐ
ArrayList<Integer> ali=new ArrayList<Integer>();
ali.add(123); //autoboxing
Object[] objs=wordlists; //ÊÇÉÏתÐÍ£¬±àÒëͨ¹ý¡£±àÒëʱobjs¸÷ÔªËØÊÇObjectÀàÐÍ£¬
//ÔËÐÐʱobjs¸÷ÔªËØÊÇArrayList<String>ÀàÐÍ
objs[0]=ali; //ÊÇÉÏתÐÍ£¬±àÒëͨ¹ý¡£±àÒëʱobjs[0]ÊÇObjectÀàÐÍ£¬
//ÔËÐÐʱÊÇArrayList<Integer>ÀàÐÍ£¬ÓëÉÏÃæµÄArrayList<String>ì¶Ü,µ«ÔËÐÐ
//ʱÈÔÎÞ´í£¬ÒòΪ¶ÔString»¹ÊÇIntegerµÄ¼ì²éÔÚ±àÒëÆÚÍê³É£¬ÔËÐÐÆÚ²¢²»ÖªµÀ
String s=wordlists[0].get(0); //ÔËÐÐʱwordlists[0](==objs[0])ÊÇ


Ïà¹ØÎĵµ£º

Java Éè¼Æģʽ(12)

Observer
Intent
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
How to
Subject
  
knows its observers. Any number of Observer objects may observe a subject.
  
provides an in ......

java±¨±íJXLºÍPOI´òÓ¡ÉèÖÃ


JXLµÄ´òÓ¡ÉèÖÃÔÚjxl.SheetSettingsÕâ¸öÀàÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ý·½·¨Sheet£¨»òÕßWritableSheet£©#getSettings()»ñÈ¡¡£
1.Ò³Ãæ
1.1·½Ïò
SheetSetting#setOrientation(PageOrientation po)£»
²ÎÊý£º  PageOrientation#LANDSCAPE       ºáÏò´òÓ¡
PageOrientation# PO ......

javaÖÐÒì³£·ÖÀà


1. Òì³£»úÖÆ
      Òì³£»úÖÆÊÇÖ¸µ±³ÌÐò³öÏÖ´íÎóºó£¬³ÌÐòÈçºÎ´¦Àí¡£¾ßÌåÀ´Ëµ£¬Òì³£»úÖÆÌṩÁ˳ÌÐòÍ˳öµÄ°²È«Í¨µÀ¡£µ±³öÏÖ´íÎóºó£¬³ÌÐòÖ´ÐеÄÁ÷³Ì·¢Éú¸Ä±ä£¬³ÌÐòµÄ¿ØÖÆȨתÒƵ½Òì³£´¦ÀíÆ÷¡£
      ´«Í³µÄ´¦ÀíÒì³£µÄ°ì·¨ÊÇ£¬º¯Êý·µ»ØÒ»¸öÌØÊâµÄ½á¹ûÀ´±íʾ³öÏÖÒì³££¨Í ......

ѧϰJavaÀàµÄÊôÐÔ

ѧϰJavaÀàµÄÊôÐÔ-Î人±±´óÇàÄñ
¡¡¡¡Public¡¢private¡¢protectedÏÔʾÁËÈýÖÖÀàÖеÄÊôÐԺͷþÎñµÄÀàÐÍ£¬publicÊÇ¿ÉÒÔËæÒâ·ÃÎʵġ¢privateÊÇÍâ½ç²»ÄÜ·ÃÎʵÄ(ÏÔʾÁËÊý¾ÝµÄ·â×°ÐÔ)¡¢protected˵Ã÷Êý¾ÝÊÇÊܱ£»¤µÄ¡£ÏÂÃæ¾ÍÀ´Ïêϸ½²ÊöÒ»ÏÂÕâÈý¸ö¾¿¾¹ÓÐʲôÇø±ð¡£
¡¡¡¡Ê×ÏÈÒªÁ˽âһϰüµÄ¸ÅÄî¡£ÓÐÈô¸É¸öÀ࣬ËüÃÇÏ໥֮¼äÓÐÒ»¶¨µÄ¹ØÏ ......

JavaÉè¼Æģʽ֮State(״̬ģʽ)

¶¨Ò壺
GOF¡¶Éè¼Æģʽ¡·Öиø״̬ģʽϵĶ¨ÒåΪ£ºÔÊÐíÒ»¸ö¶ÔÏóÔÚÆäÄÚ²¿×´Ì¬¸Ä±äʱ¸Ä±äËüµÄÐÐΪ¡£
ÏÈ¿´Ò»¸öÀý×Ó£º
package com.state;
public class KissingPrincess {
// ±ê־룬±êÖ¾ÊÇÇàÍÜ»¹ÊÇÍõ×Ó¡£
private boolean isFrog = true;
// ¸ù¾ÝisFrog½øÐв»Í¬µÄ²Ù×÷¡£
public void greet() {
if (isFrog)
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ