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

java ±£Áô2λСÊý

java  ±£Áô2λСÊý  תÔØ
·½Ê½Ò»£º
ËÄÉáÎåÈë
double   f   =   111231.5585;
BigDecimal   b   =   new   BigDecimal(f);
double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();
±£ÁôÁ½Î»Ð¡Êý
·½Ê½¶þ£º
java.text.DecimalFormat   df   =new   java.text.DecimalFormat(”#.00″);
df.format(ÄãÒª¸ñʽ»¯µÄÊý×Ö);
Àý£ºnew java.text.DecimalFormat(”#.00″).format(3.1415926)
#.00 ±íʾÁ½Î»Ð¡Êý #.0000ËÄλСÊý ÒÔ´ËÀàÍÆ…
·½Ê½Èý£º
double d = 3.1415926;
String result = String .format(”%.2f”);
%.2f %. ±íʾ СÊýµãÇ°ÈÎÒâλÊý   2 ±íʾÁ½Î»Ð¡Êý ¸ñʽºóµÄ½á¹ûΪf ±íʾ¸¡µãÐÍ¡£
·½Ê½ËÄ£º
´ËÍâÈç¹ûʹÓÃstruts±êÇ©×öÊä³öµÄ»°£¬ÓиöformatÊôÐÔ,ÉèÖÃΪformat="0.00"¾ÍÊDZ£ÁôÁ½Î»Ð¡Êý
ÀýÈ磺<bean:write name="entity" property="dkhAFSumPl"  format="0.00" />


Ïà¹ØÎĵµ£º

ÈÏʶjavaÖеÄÔËÐÐʱÒì³£

JavaÖÐÒì³£Ò»°ã·ÖΪ3À࣬ϱ߽éÉÜÏ£¬½ö½öÊǸöÈËÀí½â¡£
µÚÒ»ÖÖÊDZàÒëÆÚÒì³££¬»òÕß½Ðcheck Exception¡£
±àÒëÆÚÒì³£µÄÌص㣺
1.ϵͳҪÇó±ØÐëÔÚ³ÌÐòÀï×ö³ö´¦Àí£¬·ñÔò±¨±àÒë´íÎ󣬱àÒëÎÞ·¨Í¨¹ý£¬Ò²¾ÍÊÇ˵ϵͳǿÖÆÒªÇó´¦Àí£¬¶ÔÓÚ´¦Àí·½Ê½£¬²»ÍâºõÖ±½Ócatch´¦ÀíºÍÅ׳öµ½Íâ²ã£¬µ«ÊÇ×îÖÕ»¹ÊÇÒª´¦ÀíµÄ¡£
2.Óû§×Ô¶¨ÒåÒ»¸ö±àÒëÆÚÒ ......

java(Web)ÖÐÏà¶Ô·¾¶£¬¾ø¶Ô·¾¶ÎÊÌâ×ܽá

1.»ù±¾¸ÅÄîµÄÀí½â
¡¡¡¡¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:\xyz\test.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸ö
URL¾ø¶Ô·¾¶¡£
¡¡¡¡Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚ ......

JavaÈýÖÖ·½Ê½½âÎöxml


JavaÀï±ß½âÎöxmlÒ»°ãÓÐÈýÖÖ³£Óõļ¼Êõ£º
1¡¢ Document Object Model (DOM)£¬W3CÀï±ßÒ»ÖÖ³ÉÊìµÄ±ê×¼¡£Ä¿Ç°¹ã·ºÊ¹ÓõĽâÎö¹¤¾ß£ºJDOM DOM4J
2¡¢ Simple API for XML (SAX)£¬µÚÒ»ÖÖ±»¹ã·º½ÓÊܵÄXMLµÄAPI£¬³ÉΪÊÂʵÉϵıê×¼¡£
3¡¢ Streaming API for XML (StAX)£¬ÔÚJSR-173ÖÐÌáµ½µÄÒ»ÖÖºÜÓÐǰ;µÄÐÂÐͽâÎöÄ ......

javaÀïÃæһЩÄãÒ²Ðí»¹²»ÖªµÀµÄ¶«Î÷

JavaÀïÃæµÄdnd;
 ½çÃæ±à³ÌÀïÃæÄÜÊìÁ·µÄÔËÓõÄÈ˲»¶à,¶ø¶ÔJavaÖеÄÍÏק֪¸ùÖªµ×µÄÈ˾͸üÉÙÁËÎÒµÄһƪ ÎÄÕÂ-- JavaÖеÄDrag and DropÏê½âÓë´úÂëʾÀý ÀïÃæÓÐÏêϸ½éÉÜ.
java.awt.MouseInfo, java.awt.PointerInfo;
 ÎÒÔø¾­ÏëµÃµ½Êó±êÔÚÆÁÄ»Éϵľø¶ÔλÖÃ,ÎÒÊÔ¹ýͨ¹ýÔÚMouseListenerÀïÃæµÃµ½Êó±êÔÚÒ»¸ö¿Ø¼þÀïÃæµÄÏච......

JavaÖÐ ArrayList¡¢VectorºÍLinkedList µÄʹÓÃ


/*
ArrayListÊÇ×î³£ÓõÄListʵÏÖÀ࣬ÄÚ²»ÊÇͨ¹ýÊý×éʵÏֵģ¬ËüÔÊÐí¶ÔÔªËؽøÐпìËÙËæ»ú·ÃÎÊ¡£Êý×éµÄȱµãÊÇÿ¸öÔªËØÖ®¼ä²»Äܺ¬ÓГ¿Õ϶”£¬µ±Êý×é´óС²»Âú×ãʱÐèÒªÔö¼Ó´æ´¢ÄÜÁ¦£¬¾ÍÒª½«ÒÑÓÐÊý×éÊý¾Ý¸´ÖƵ½ÐµĴ洢¿Õ¼äÖС£µ±´ÓArrayListµÄÖмäλÖòåÈë»òÕßɾ³ýÔªËØʱ£¬ÐèÒª¶ÔÊý×é½øÐи´ÖÆ¡¢Òƶ¯£¬´ú¼Û±È½Ï¸ß¡£Òò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ