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

javaµÄdoubleµÄ¾«¶ÈÎÊÌâ

ÔÚjavaÖУ¬Ê¹ÓÃdouble½øÐÐÔËË㣬ÓÐʱ»á³öÏÖ¾«¶È¶ªÊ§µÄÎÊÌ⣬ֵ»áÓÐÄÇô0.00000***1Æ«²îµÄÆ«²î£¬µ¼ÖÂÆ¥ÅäУÑé³£³£³öÏÖÎÊÌâ
½â¾ö·½°¸ÈçÏÂ:
  /** 
     * ¶ÔdoubleÊý¾Ý½øÐÐÈ¡¾«¶È. 
     * @param value  doubleÊý¾Ý. 
     * @param scale  ¾«¶ÈλÊý(±£ÁôµÄСÊýλÊý). 
     * @param roundingMode  ¾«¶ÈÈ¡Öµ·½Ê½. 
     * @return ¾«¶È¼ÆËãºóµÄÊý¾Ý. 
     */ 
    public static double round(double value, int scale,
             int roundingMode) {  
        BigDecimal bd = new BigDecimal(value);  
        bd = bd.setScale(scale, roundingMode);  
        double d = bd.doubleValue();  
        bd = null;  
        return d;  
    }  
     /**
     * double Ïà¼Ó
     * @param d1
     * @param d2
     * @return
     */
    public double sum(double d1,double d2){
        BigDecimal bd1 = new BigDecimal(Double.toString(d1));
        BigDecimal bd2 = new BigDecimal(Double.toString(d2));
        return bd1.add(bd2).doubleValue();
    }
    /**
     * double Ïà¼õ
     * @param d1
     * @param d2
     * @return
     */
    public double sub(double d1,double d2


Ïà¹ØÎĵµ£º

JavaÉè¼Æģʽ֮:IteratorÁ´±íģʽ

ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔ­Àí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
   
    private Object data; //ÔªËر¾Éí
    private NodeBean next; //ÏÂÒ»¸ö½Úµã
   
  &n ......

java תjson

commons-beanutils-1.8.0.jar²»¼ÓÕâ¸ö°ü
java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean
commons-collections.jar ²»¼ÓÕâ¸ö°ü
java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ListOrderedMap
commons-lang-2.4.jar²»¼ÓÕâ¸ö°ü
java.lang.NoClassDefFoundError: org/apa ......

javaÕýÔò±í´ïʽÖеÄÊýÁ¿´Ê

    javaÖеÄÕýÔòλÓÚjava.util.regex°üÖУ¬Õâ¸ö°üÖÐÖ»ÓÐÒ»¸öMatchResult½Ó¿ÚºÍMatcher¡¢PatternÁ½¸öÀà¡£
   ÕýÔòÖеÄÊýÁ¿´ÊÓÐGreedy (Ì°À·)¡¢Reluctant(ÀÁ¶è)ºÍPossessive(Ç¿Õ¼)ÈýÖÖ
  
 Greedy ÊýÁ¿´Ê
X?
X£¬Ò»´Î»òÒ»´ÎҲûÓÐ
X*
X£¬Áã´Î»ò¶à´Î
X+
X£¬Ò»´Î»ò¶à´Î
X{n ......

JavaÉè¼Æģʽ֮Flyweightģʽ


GOF£ºÔËÓù²Ïí¼¼ÊõÓÐЧµØÖ§³Ö´óÁ¿Ï¸Á£¶ÈµÄ¶ÔÏó¡£
 
½âÊÍһϸÅÄҲ¾ÍÊÇ˵ÔÚÒ»¸öϵͳÖÐÈç¹ûÓжà¸öÏàͬµÄ¶ÔÏó£¬ÄÇôֻ¹²ÏíÒ»·Ý¾Í¿ÉÒÔ
ÁË£¬²»±Øÿ¸ö¶¼È¥ÊµÀý»¯Ò»¸ö¶ÔÏó¡£±ÈÈç˵£¨ÕâÀïÒýÓÃGOFÊéÖеÄÀý×Ó£©Ò»¸öÎı¾ÏµÍ³£¬Ã¿¸ö×Öĸ¶¨Ò»¸ö¶ÔÏó£¬ÄÇô´óСд×Öĸһ¹²¾ÍÊÇ52¸ö£¬ÄÇô¾ÍÒª¶¨Òå
52¸ö¶ÔÏó¡£Èç¹ûÓÐÒ»¸ö1MµÄÎ ......

javaÖÐStringÀàµÄ¹¹Ô캯Êý

StringÀàÖеĹ¹Ô캯Êý
String(); ¹¹ÔìÒ»¸ö¿Õ×Ö·û´®¶ÔÏó
String(byte[] bytes); ͨ¹ýbyteÊý×é¹¹Ôì×Ö·û´®¶ÔÏó
String(byte[] bytes,int offset,int length);ͨ¹ýbyteÊý×飬´Óoffset¿ªÊ¼£¬×ܹ²length³¤µÄ×Ö½Ú¹¹Ôì×Ö·û´®¶ÔÏó
String(char[] value); ͨ¹ýcharÊý×é¹¹Ôì×Ö·û´®¶ÔÏó
String(byte[] char,int offset,int length) ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ