JAVAÖÐintתStringÀàÐÍЧÂʱȽÏ
´ó¼Ò¶¼ÖªµÀJAVAÖÐ int ÀàÐÍҪת»¯³É String ÀàÐÍ£¬¿ÉÒÔÓÐÈýÖÖ·½Ê½£¬·Ö±ðÊÇ£º
* (1) String.valueOf(i)
* (2) Integer.toString(i)
* (3) i+""
ÒòΪǰÁ½Ì죬дһ¸ö³ÌÐòʱ£¬ÒªÓõ½ int ת String ,²¢ÇÒÊý¾ÝÁ¿ºÜ´ó£¬Òò´ËÏë¿´¿´ÕâÈýÖÖ·½Ê½µÄЧÂÊÔõÑù£¬Ð´ÁËһϼòµ¥µÄ²âÊÔ³ÌÐò£¬Ôڴ˼ǼһÏ¡£
Java´úÂë
public class TestIntToStr {
public static void main(String[] args) {
int[] intArr = new int[1000000];
String[] strArr1 = new String[1000000];//ΪÁ˹«Æ½·Ö±ð¶¨ÒåÈý¸öÊý×é
String[] strArr2 = new String[1000000];
String[] strArr3 = new String[1000000];
//¸³Öµ
Long t1 = System.currentTimeMillis();
for(int i=0;i<1000000;i++){
intArr[i]=i+1;
}
Long t2 = System.currentTimeMillis();
for(int i=0;i<1000000;i++){
strArr1[i] = String.valueOf(intArr[i]);
}
Long t3 = System.currentTimeMillis();
for(int i=0;i<1000000;i++){
strArr2[i] = Integer.toString(intArr[i]);
}
Long t4 = System.currentTimeMillis();
for(int i=0;i<1000000;i++){
strArr3[i] = intArr[i]+"";
}
Long t5 = System.currentTimeMillis();
System.out.println("t1 = "+t1); &
Ïà¹ØÎĵµ£º
package test;
public class TestFactory<T> {
private Class <T> cls;
public String testabc="";
pub ......
4 ÔÚjava´úÂëÀïǶÈëFirefox3
ÏÖÔÚ¿ÉÒÔÈ¥ÓÃÒ»ÏÂÓÐÓõÄÀý×ÓÁË¡£Ê×ÏÈÎÒÃÇÔÚÒ»¸öjava³ÌÐòÀïʹÓÃSWTÀ´Ç¶ÈëÒ»¸öMozillaä¯ÀÀÆ÷¡£ÏÖÔÚ£¬ÎÒÃÇ¿ÉÒÔʹÓÃ
org.eclipse.swt.browser.BrowserÀàÀ´ÊµÀý»¯£ºbrowser = new Browser(shell, SWT.MOZILLA); ÔÚÕâ֮ǰ£¬ÎÒÃÇÐèҪʹÓÃATFÏîÄ¿
£¬ÒÔ¼°Ò»ÏÂATF²å¼þ¡£·Ç³£ÐÒÔË£¬ÏÖÔÚÎÒÃDz»ÐèÒ ......
6 ¼ÓÔØÒ³ÃæµÄW3C DOM·ÃÎÊ
6.1 mozdom4java¿â
·ÃÎÊW3C DOMÊ÷±È·ÃÎÊMozillaµÄDOMÊ÷ÒªºÃ£¬ÒòΪËüÊÇÒ»¸ö¶¯Ì¬·ÃÎÊHTMLºÍXMLµÄDOMÊ÷µÄ±ê×¼¡£ÎªÁËʵÏÖÕâ¸ö£¬ÎÒÃÇʹÓôÓMozilla
DOMµ½W3C DOMµÄjava Bridge¡£ÓÐÒ»¸ö½Ð×ömozdom4javaµÄÏîÄ¿http://mozdom4java.mozdev.org/index.html¡£
ÏÂÔØÕâ¸ö°üºó£¬ÎÒÃÇ°Ñjar°ü·Å ......
7.3 µã»÷ElementºÍÌîд±íµ¥
ÎÒÃÇ¿ÉÒÔ°²È«µÄ¼ÓÔØÒ³Ã棬³éÈ¡ÐÅÏ¢£¬µ«ÊÇÓÐʱä¯ÀÀÍøÒ³ÊÇÐèÒªÌîд±íµ¥²¢Ìá½»»òÕßµã»÷ij¸öÔªËØÀ´´¥·¢onclickÒÔ±ãÖ´ÐÐÒ»¶Î
JavaScript´úÂë¡£
àÅ£¬ÒªÏëµã»÷Ò»¸öelementÐèÒª»ñµÃÕâ¸öelement(Ç°ÃæµÄxpathNodesÒ²Ðí¿ÉÒÔ°ïÎÒÃÇ×öµ½Õâµã)£¬Èç¹ûÊÇinput element£ ......