Java СÊý¾«È·¼ÆËãÎÊÌâ
System.out.println(2.00 -1.10);//0.8999999999999999
ÉÏÃæµÄ¼ÆËã³öµÄ½á¹û²»ÊÇ0.9£¬¶øÊÇÒ»Á¬´®µÄСÊý¡£ÎÊÌâÔÚÓÚ1.1 Õâ¸öÊý×Ö²»Äܱ»¾«È·±íʾ
Ϊһ¸ödouble£¬Òò´ËËü±»±íʾΪ×î½Ó½üËüµÄdouble Öµ£¬¸Ã³ÌÐò´Ó2 ÖмõÈ¥µÄ¾ÍÊÇÕâ¸öÖµ£¬
µ«Õâ¸ö¼ÆËãµÄ½á¹û²¢²»ÊÇ×î½Ó½ü0.9 µÄdoubleÖµ¡£
Ò»°ãµØ˵£¬ÎÊÌâÔÚÓÚ²¢²»ÊÇËùÓеÄСÊý¶¼¿ÉÒÔÓöþ½øÖƸ¡µãÊý¾«È·±íʾ¡£
¶þ½øÖƸ¡µã¶ÔÓÚ»õ±Ò¼ÆËãÊǷdz£²»Êʺϵģ¬ÒòΪËü²»¿ÉÄܽ«1.0 ±íʾ³É10 µÄÆäËûÈκθº´Î
ÃÝ¡£
½â¾öÎÊÌâµÄµÚÒ»ÖÖ·½Ê½ÊÇʹÓûõ±ÒµÄ×îСµ¥Î»£¨·Ö£©À´±íʾ£ºSystem.out.println(200-110);//90
µÚ¶þÖÖ·½Ê½ÊÇʹÓÃBigDecimal£¬µ«Ò»¶¨ÒªÓÃBigDecimal(String)¹¹ÔìÆ÷£¬¶øǧÍò²»ÒªÓÃ
BigDecimal(double)À´¹¹Ô죨Ҳ²»Äܽ«float»òdoubleÐÍת»»³ÉStringÔÙÀ´Ê¹ÓÃBigDecimal(String)
À´¹¹Ô죬ÒòΪÔÚ½«float»òdoubleת»»³ÉStringʱ¾«¶ÈÒѶªÊ§£©¡£ÀýÈçnew BigDecimal(0.1)£¬Ëü
½«·µ»ØÒ»¸öBigDecimal£¬Ò²¼´
0.1000000000000000055511151231257827021181583404541015625£¬ÕýȷʹÓÃBigDecimal£¬³Ì
Ðò¾Í¿ÉÒÔ´òÓ¡³öÎÒÃÇËùÆÚÍûµÄ½á¹û0.9£º
System.out.println(new BigDecimal("2.0").subtract(new BigDecimal("1.10")));// 0.9
ÁíÍ⣬Èç¹ûÒª±È½ÏÁ½¸ö¸¡µãÊýµÄ´óС£¬ÒªÊ¹ÓÃBigDecimalµÄcompareTo·½·¨¡£
Ïà¹ØÎĵµ£º
btraceÊÇsunÍƳöµÄÒ»¿îjavaÐÔÄܼà¿Ø¹¤¾ß£¬ÀûÓÃjava agent ºÍ jvm attach¼¼Êõ£¬¿ÉÒÔ²»Í£»úµÄÇé¿öϼà¿ØÏßÉÏÇé¿ö£¬²¢ÇÒ×öµ½×îÉÙµÄÇÖÈ룬ռÓÃ×îÉÙµÄϵͳ×ÊÔ´¡£
Ïêϸ¼û¹Ù·½Îĵµ
ÁíÍâbtraceÓкÜÑϸñµÄÏÞÖÆ£¬±ÈÈçÆ´½Ó×Ö·û´®¡¢Ñ»·¡¢µÝ¹é¡¢ÒÔ¼°ÎÒÃÇƽʱ¾³£ÓõÄһЩ·½·¨¶¼²»¿ÉÒÔÓã¬ËûÓÐËû×Ô¼º×¨ÃŵÄÀà¿â¡£
btrace»¹ÌṩÁËVi ......
JAVAÎļþ²Ù×÷×ܽá
FileÀà
File f = new File(path);
pathΪʵ¼Ê·¾¶£¬¸Ã·¾¶¿ÉÒÔÊÇÎļþ£¬»òÎļþ¼Ð£¬Ò²¿ÉÒÔÊDz»´æÔڵġ£
f.exists() ¿ÉÒÔÅжϸ÷ÊÇ·ñ´æÔÚ¡£
f.isDirectory() ¿ÉÒÔÅжÏÊÇ·ñÊÇÎļþ¼Ð¡£
f.mkdirs(); µÝ¹é´´½¨Îļþ¼Ð
FileºÍÊäÈëÊä³öÁ÷Ö®¼äŦ´øFileInutStream£¬FileOutputStream
URL url = new URL(strUr ......
annotations : ×¢ÊÍ
ºÃ´¦
1.Îĵµ±àÖÆ
2.±àÒëÆ÷¼ì²é
3.´úÂë·ÖÎö
JSR 175 ÊDZà³ÌÓïÑÔµÄÔªÊý¾Ý¹¤¾ß,Ϊ½«ÔªÊý¾ÝºÏ²¢µ½ºËÐÄjavaÓïÑÔÖÐÌṩÕýʽÀíÓɺÍ˵Ã÷
»ù±¾ÖªÊ¶:
×¢ÊͲÉÓÃ"@"±ê¼ÇÐÎʽ,ºóÃæÊÇ×¢ÊÍÃû³Æ,È»ºóÔÚÐèÒªÊý¾Ýʱ,ͨ¹ýname=value¶ÔÏò×¢ÊÍÌṩÊý¾Ý
×¢Ê͵ÄÈý¸ö»ù±¾ÖÖÀà:
±ê¼Ç×¢ÊÍ ......
×î½ü¹«Ë¾Òª¿ª·¢Windowsƽ̨ÉϵIJúÆ·£¨ÓÉÓÚÉæ¼°µ½ÉÌÒµ»úÃÜ£¬ËùÒÔÄ¿Ç°ÎÞ·¨¶ÔÕâ¸ö²úÆ·×öÏêϸ½éÉÜ£©£¬²ÉÓÃ.Net¼¼Êõ½øÐпª·¢£¬ÎÒ¸ºÔðµÄÊÇ»ùÓÚ Visual Studio²å¼þ»úÖƵÄÐÐÒµ¿ª·¢¹¤¾ßµÄ¿ª·¢¡£´Ó¿ªÊ¼½Ó´¥.Netµ½ÏÖÔÚÒѾÓнüÈý¸öÔÂÁË£¬¶øÇÒÒ²¿ª·¢³öÁ˵ÚÒ»¸ö°æ±¾£¬¶Ô.NetÒѾÓÐÁËһЩÈÏʶ£¬ÓÉÓÚÒÔÇ°Ö÷ÒªÓÃJava¡¢PythonµÈÓïÑ ......