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

java ¸ñʽ»¯Êä³ö

Ò»¡¢java.util.Formatter
 
java.util.Formatter ÊÇJDK1.5ÐÂÔöµÄÀà¿â£¬¹¦ÄܺÜÇ¿´ó£¬µ«ÊDz»ºÃÕÆÎÕ£¬¾ÍÏñÏÂÆåÒ»Ñù£¬ÖªµÀÈçºÎ×ßÆå×Ó£¬ºÍÊìÁ·Ó¦ÓÃÍêÈ«ÊÇÁ½ÂëÊ¡£
 
¸ñʽ»¯Ö÷ÒªÓÃÔÚÎı¾Êä³ö·½Ã棬±ÈÈ磬Êý×Ö¡¢ÈÕÆÚ¡¢½ð¶îµÈ£¬»¹ÓÐÀàËƳ¬ÊеĹºÎﵥСƱµÈµÈ£¬¶¼»áÓõ½¸ñʽ»¯Êä³öµÄ¹¤¾ß¡£ÔÚ´ËÀàû³öÏÖ֮ǰ£¬Ö»ÄÜͨ¹ý¿Õ¸ñËõ½ø»òÕâ¸öÖƱí·ûÀ´¶Ôµ¥¾ÝµÈ¸ñʽ×öһЩ¿ØÖÆ£¬ÏÖÔÚÖ»ÒªÕÆÎÕjava.util.Formatter£¬Ò»ÇÐÎÊÌâ¾Í½â¾öÁË¡£
 
shut£¡ÓйØÕâ¸öÀàjavadocÎĵµÌ«ÄÑ¿´¶®ÁËÏÂÃæµÄÀý×Ó£º
 
import java.util.Calendar;
import java.util.Formatter;
import java.util.GregorianCalendar;
/**
* Formatter²âÊÔ
*
* @author leizhimin 2009-7-16 16:31:02
*/
public class TestFormatter {
        public static void main(String[] args) {
                //%[argument_index$][flags][width][.precision]conversion
                Formatter f1 = new Formatter(System.out);
                //¸ñʽ»¯Êä³ö×Ö·û´®ºÍÊý×Ö
                f1.format("¸ñʽ»¯Êä³ö£º%s %d", "a", 1235);
                System.out.println("\n--------");
                //ÈÕÆڵĸñʽ»¯
                Calendar c = new GregorianCalendar();
                f1.format("µ±Ç°ÈÕÆÚ:%1$tY-%1$tm-%1$te", c);
                System.out.println("\n--------");
    &nbs


Ïà¹ØÎĵµ£º

java ʵÏÖÏÂÔع¦ÄÜ

/**
* ÏÂÔØÎļþ
* @param filePath --ÎļþÍêÕû·¾¶
* @param response --HttpServletResponse¶ÔÏó
*/
public static void downloadFile(
String filePath,
javax.servlet.http.HttpServletResponse response) {
String fileName = ""; //ÎļþÃû£¬Êä³öµ½Óû§µÄÏÂÔضԻ°¿ò
//´ÓÎļþÍêÕû·¾¶ÖÐÌáÈ¡ÎļþÃû£¬²¢½øÐбà ......

ÔÚJava 3DÖÐÔØÈëÍⲿ3DÄ£ÐÍÎļþ

Java 3DËäÈ»ÄÜÖ§³ÖÖÚ¶àµÄÍⲿ3DÄ£ÐÍÎļþ£¬µ«ÄÜÖ§³Ö±»Java 3DʹÓõÄÍⲿģÐÍÎļþ½öΪ.objºÍ.lwdÁ½ÖÖ£»·Ö±ð¶ÔÓ¦ObjectFileÀàºÍLw3dLoaderÀà¡£Ïà±È֮ϼ¸¿îÖ÷Á÷µÄ3D½¨Ä£Èí¼þ¶¼ÄÜÉú³É.obj¸ñʽµÄÎļþ£¬Òò´Ë±¾ÎÄÖ÷Òª½éÉÜʹÓÃObjectFileÀàÔØÈë.objÎļþµÄ·½·¨¡£
ObjectFileÀàÓÐÈý¸ö¹¹Ôì·½·¨£¬·Ö±ðΪ£º
ObjectFile()
ObjectFile( ......

Object Ordering java ÅÅÐò

Object Ordering
A List l may be sorted as follows.
Collections.sort(l);
If the List consists of String elements, it will be sorted into alphabetical order. If it consists of Date elements, it will be sorted into chronological order. How does this happen? String and Date both implement the Compara ......

JAVA WebServiceʵÀý

Ò»¡¢Axis°²×° 1¡¢»·¾³ J2SE SDK 1.5 or 1.6: ÎÒʹÓà 1.6 Servlet Container: ÎÒʹÓõÄTomcat 6.0
2¡¢µ½ http://ws.apache.org/Axis/ÍøÕ¾ÏÂÔØAxis°²×°°ü
3¡¢ÏÈÔÚeclipseÏÂн¨web projectΪWebServiceDemo.ÔÚTomcatµÄÅäÖÃxmlÅäÖÃÉÏ£º<Context path="/webservice" docBase="D:\workspace\WebServiceDemo\WebRoot"/>. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ