javaÊý×ֵĸñʽ»¯
1) ¸ñʽ»¯ÕûÊý(°Ñ¸¡µãÊýת»¯ÎªÕûÊý)
NumberFormat nf = NumberFormat.getIntegerInstance();
double v=12.6;
System.out.println(nf.format(v));
Êä³ö½á¹û13£¬ÒòΪ×Ô¶¯ÉáÈëµÄ¡£
2£©¸ñʽ»¯¸¡µãÊý£¨±£ÁôÁ½Î»Ð¡Êý,×Ô¶¯½øÎ»,¸ºÊýÒ²¿ÉÒÔ£©
·½·¨Ò»:
DecimalFormat df=new DecimalFormat("#.##");
double v=12.126;
String s=df.format(v);
System.out.println(s);
Êä³öµÄ½á¹ûΪ:12.13
·½·¨¶þ:
double v=-32.126;
String s=v+"";
System.out.println(s.substring(0, s.indexOf(".")+3));
(²»ÍƼöʹÓô˷½·¨£¬ÒòΪÈç¹ûÔÊý²»´æÔÚСÊýµã»òÕßСÊýµãºóÖ»ÓÐ1Ϊ»áÓÐÒì³£)
3) ¸ñʽ»¯¸¡µãÊý£¨±äΪxx%ÐÎʽ£©
NumberFormat nf = NumberFormat.getPercentInstance();
double s=0.6145;
System.out.println(nf.format(s));
Êä³ö61%
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
ÔÚJAVAÖнøÐÐÎļþµÄ¶Áд²Ù×÷Ö÷ÒªÓõ½ÁËJAVAÖеÄÊäÈëÊä³ö£¨IO£©API£¬Java I/OÌṩÁËÐí¶àAPIÌṩ¶ÔÎļþ£¬Äڴ棬socketµÄ¶ÁдµÈ£¬±¾ÎÄÖ÷Ҫͨ¹ýʵÀýÀ´½²½âÔõÑùÀí½âjavaÖеÄÊäÈëÊä³ö¡£
Ò»£¬»ù±¾¸ÅÄî
Á÷£¨Stream£©£º
Á÷ÊÇÒ»ÖÖÓÐÐòµÄ×Ö½ÚÊý¾Ý¶ÔÏó¡£Á÷ÓÖ·ÖΪÊäÈëÁ ......
ÔÚJavaÖУ¬²»Í¬µÄÀà¶¼ÓÐ×Ô¼ºµ¥¶ÀµÄCache»úÖÆ£¬ÊµÏֵķ½·¨Ò²¿ÉÄÜÓÐËù²»Í¬£¬ÎÄÕÂÁоÙÁËJavaÖг£¼ûµÄ¸÷ÀàCache»úÖÆµÄʵÏÖ·½·¨£¬Í¬Ê±½øÐÐÁË×ۺϵıȽϡ£
OSCache
OSCacheÊǸöÒ»¸ö¹ã·º²ÉÓõĸßÐÔÄܵÄJava EE»º´æ¿ò¼Ü£¬OSCacheÄÜÓÃÓÚÈκÎJavaÓ¦ÓóÌÐòµÄÆÕͨµÄ»º´æ½â¾ö·½°¸¡£
OSCacheÓÐÒÔÏÂÌØµã£º»º´æÈκζÔÏó£¬Äã¿ÉÒÔ²»ÊÜÏÞÖÆµ ......
Ò».ÔõÑùÓÃsocket½øÐпͻ§Óë·þÎñÆ÷ͨÐÅ
ÔÚJavaÖÐÓÃsocket½øÐпͻ§/·þÎñÆ÷Ö®¼äµÄͨÐűà³Ì¡£SocketÊÇÁ½¸öʵÌåÖ®¼ä½øÐÐͨÐŵÄÓÐЧ¶Ëµã¡£Í¨¹ýsocket¿ÉÒÔ»ñµÃÔ´IPµØÖ·ºÍÔ´¶Ë¿Ú¡¢ÖÕµãIPµØÖ·ºÍÖÕµã¶Ë¿Ú¡£Óû§¿ÉÒÔ½«¶à¸ösocketÁ¬Èëͬһ¸ö¶Ë¿Ú£¬ÒÔ±ã¶ÔÓÚµ¥¸ö¶Ë¿Ú¿ÉÒÔÓжà¸öÁ¬½Ó¡£Í¨¹ýsocket¿Í»§/·þÎñÆ÷±à³Ì¿ÉÒÔ´´½¨Ò»¸öÄܱ»Ðí¶àÈËÊ¹Ó ......
Ôڳɹ¦ÊµÏÖJavaµ÷ÓÃC++Ö®ºó£¬½ÓÏÂÀ´Ïëµ½ÄÜ·ñͨ¹ýJNAʵÏÖJavaµ÷ÓÃFortran£¬½ñÌìÊÔÑéÁËһϣ¬»¹ÊDZȽÏÈÝÒ׵ġ£
ÍøÉÏÓÐÒ»¸öJavaµ÷ÓÃF95µÄÀý×Ó£¬µ«ÊÇÎÒ¿¼ÂDz»½öҪʵÏÖF95µÄµ÷Ó㬻¹ÒªÊµÏÖF77µÄµ÷Óã¬ËùÒÔ·ÑÁËһЩÖÜÕÛ¡£
ÎÊÌâµÄ¹Ø¼üÔÚÓÚF77Ϊ¹ý³ÌÃû×Ô¶¯Ìí¼ÓÁËÒ»¸öβ²¿µÄÏ»®Ïߣ¬ËùÒÔsub1Õâ¸ö¹ý³Ì£¬µ½JavaÒ»¶Ë£¬¾Í±ä³ÉÁËsub1_£¬ ......