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

ÕûÀíÓÃJavaʵÏÖÊý×Öת»¯³É×Ö·û´®×ó±ß×Ô¶¯²¹Áã·½·¨

Java ÖиøÊý×Ö×ó±ß²¹0 £¨1£©·½·¨Ò»
import java.text.NumberFormat; public class NumberFormatTest {     public static void main(String[] args) {
        //´ý²âÊÔÊý¾Ý
        int i = 1;
        //µÃµ½Ò»¸öNumberFormatµÄʵÀý
        NumberFormat nf = NumberFormat.getInstance();
        //ÉèÖÃÊÇ·ñʹÓ÷Ö×é
        nf.setGroupingUsed(false);
        //ÉèÖÃ×î´óÕûÊýλÊý
        nf.setMaximumIntegerDigits(4);
        //ÉèÖÃ×îСÕûÊýλÊý   
        nf.setMinimumIntegerDigits(4);
        //Êä³ö²âÊÔÓï¾ä
        System.out.println(nf.format(i));
    }
} À´Ô´£ºhttp://blog.csdn.net/xiaohunzhang/archive/2008/08/07/2782592.aspx £¨2£©·½·¨¶þ£¨¸öÈËÒÔΪ¸Ã·½·¨¼òµ¥ÓÐЧ£¬µ«¾­ÊÔÑéËƺõString.format()º¯ÊýÓÐÎÊÌ⣩ public class TestStringFormat {      
  public static void main(String[] args) {      
    int youNumber = 1;      
    // 0 ´ú±íÇ°Ãæ²¹³ä0      
    // 4 ´ú±í³¤¶ÈΪ4      
    // d ´ú±í²ÎÊýΪÕýÊýÐÍ      
    String str = String.format("%04d", youNumber);      
    System.out.println(str); // 0001      
  }      
}    
À´Ô´£ºhttp://liuwei1981.javaeye.c


Ïà¹ØÎĵµ£º

java»ñÈ¡³ÌÐòµ±Ç°Ä¿Â¼¡£

import java.net.URL;
import java.net.URLDecoder;
public class PathUtil
{
 /**
  * Get the env of windir, such as "C:\WINDOWS".
  * @return the env of windir value.
  */
 public static String getWindir(){
  return System.getenv("windir");
 }
 
......

java.lang.OutOfMemoryError: Java heap space

 
ÎÊÌâÃèÊö
Exception in thread "main" java.lang.OutOfMemoryError:
Java heap space
½â¾ö·½°¸[ת]
Ò»Ö±¶¼ÖªµÀ¿ÉÒÔÉèÖÃjvm heap´óС£¬Ò»Ö±ÓÃeclipseд/µ÷ÊÔjava³ÌÐò¡£Ò»Ö±ÓÃÃüÁîÐÐor
console¼Ó²ÎÊýÅܳÌÐò¡£ÏÖÏó£ºÔÚeclipseµÄÅäÖÃÎļþeclipse.iniÖÐÉèÖÃ-vmargs -Xms500m
-Xmx1024m
£¬ÔÚeclipseÖ ......

java ·ÃÎÊ¡£net webservice

java·ÃÎÊ¡£netµÄwebservice ¶øÇÒ ·µ»ØÖµÊÇÒ»¸öÀ࣬ÕâÍæÒâÕÛÄ¥ÎÒÒ»Ì죬³öÏÖ¹ýһϵÁеÄÎÊÌ⣬
°üÀ¨ ûÓж¨ÒåSoapAction ²»ÄÜÐòÁл¯ÀàµÈµÈ¡£ ×îºó»¹ÊÇ·þÎñÌṩÉ̸øÁ˸ödemo£¬½â¾öÁË £¬Ô­ÒòÊÇÎÒ·µ»Ø×Ô¶¨ÒåÀàµÄÒ»¸ö±äÁ¿Ã»ÓÐgetº¯Êý£¬¿É³Ü°¡¡£¶øÇÒdemoÀïµÄ´úÂë ÎÒÏëÒ²ÊÇÓÃwsdd2javaÉú³ÉµÄ£¬ÎÒÒÔÇ°Ò²¿´µ½¹ýÕâÖÖģʽµÄʵÏÖ£¬¿´×Å·Ñ ......

java mail Ïà¹Ø

¡¾ÉùÃ÷¡¿×ªÌûµØÖ· £º http://tech.ddvip.com/2009-04/1239788309115180.html
MailSenderInfo .java :
package com.util.mail;
import java.util.Properties;
/**
* @author AllanKing
* @date 2009-11-12
*/
public class MailSenderInfo {
// ·¢ËÍÓʼþµÄ·þÎñÆ÷µÄIPºÍ¶Ë¿Ú
private String mailServerHost; ......

´ø×Åjavaѧpython

 pythonÕýÎÄ£º     ºÍÆäËüÓïÑÔÒ»Ñù£¬ÎÒÃÇ¿ÉÒÔÒÔÃüÁîÐеÄÐÎʽ¸øÄãµÄpython³ÌÐò´«µÝ²ÎÊý£¬pyhtonÄܹ»×Ô¶¯°ÑÃüÁîÐвÎÊýÒÔ×Ö·û´®ÁбíµÄÐÎʽ´æ´¢ÔÚsysÄ£¿éµÄarv±äÁ¿¡£ok£¬ÎÒÃÇÏÈÀ´¿´¸öÀý³Ì£º
 
#  ÎļþÃû: printargs.py
#ÓÃ;£ºÑÝʾpythonµÄ´«²Î
import sys
print sys.argv
ÔÚÃü ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ