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

java×Ô¶¯×°Ïä¡¢×Ô¶¯²ðÏäºÍÕý³£Çé¿öÐÔÄܱȽÏ

×Ô¶¯×°ÏäºÍ×Ô¶¯²ðÏäÊÇjava5.0°æ±¾ÒýÈëµÄ£¬ÄÜ×Ô¶¯½«»ù±¾ÀàÐÍת»»Îª¶ÔÓ¦µÄ»ù±¾ÀàÐͰü×°¶ÔÏó£¬ÄÇôÎÒÃDZȽÏÒ»ÏÂËûÃǵÄÐÔÄÜÇé¿ö¡£
package com.wmmad.test;
import junit.framework.TestCase;
/**
* @author madding.lip
*
* <pre>
* class: compare the autoboxing and unboxing and normal's performance
* </pre>
*
*/
@SuppressWarnings("unused")
public class BoxTest extends TestCase {
public static void main(String[] args) {
testAutoboxing();
testUnboxing();
testChangeToObject();
testChangeToData();
testNormal();
testNormal1();
}
public static void testAutoboxing() {
long start = System.currentTimeMillis();
Integer result = 0;
for (int i = 0; i < 1000000000; i++) {
result = i; // autoboxing
}
long end = System.currentTimeMillis();
System.out.println("autoboxing use time is£º " + (end - start) + "ms");
}
public static void testUnboxing() {
int result = 0;
long start = System.currentTimeMillis();
for (Integer i = 0; i < 1000000000; i++) {
result = i;
}
long end = System.currentTimeMillis();
System.out.println("unboxing use time is£º " + (end - start) + "ms");
}

public static void testChangeToObject() {
Integer result = 0;
long start = System.currentTimeMillis();
for(int i = 0; i < 1000000000; i++) {
result = (Integer)i;
}
long end = System.currentTimeMillis();
System.out.println("change to object use time is: " + (end - start) + "ms");
}

public static void testChangeToData() {
int result = 0;
long start = System.currentTimeMillis();
for(Integer i = 0; i < 1000000000; i++) {
result = i.intValue();
}
long end = System.currentTimeMillis();
System.out.println("change to data use time is: " + (end - start) + "ms");
}
public static void testNormal() {
int result = 0;
long start = System.currentTimeMillis();
for (int i = 0; i


Ïà¹ØÎĵµ£º

ÀûÓÃLuceneËÑË÷JavaÔ´´úÂë

Ä³Ð©ÍøÕ¾ÔÊÐíÈí¼þ¿ª·¢ÉçÍÅͨ¹ý·¢²¼¿ª·¢ÕßÖ¸ÄÏ¡¢°×ƤÊé¡¢FAQs¡¾³£¼ûÎÊÌâ½â´ð¡¿ºÍÔ´´úÂëÒÔʵÏÖÐÅÏ¢µÄ¹²Ïí¡£Ëæ×ÅÐÅÏ¢Á¿µÄÔö³¤£¬ºÍ¼¸¸ö¿ª·¢Õß¹±Ï׳ö×Ô¼ºµÄ֪ʶ¿â£¬ÓÚÊÇÍøÕ¾ÌṩËÑË÷ÒýÇæÀ´ËÑË÷Õ¾µãÉÏÏÖÓеÄËùÓÐÐÅÏ¢¡£ËäÈ»ÕâЩËÑË÷ÒýÇæ¶ÔÎı¾ÎļþµÄËÑË÷¿ÉÒÔ×öµÄºÜºÃ£¬µ«¶Ô¿ª·¢ÕßËÑË÷Ô´´úÂë×öÁ˱ȽÏÑϸñµÄÏÞÖÆ¡£ËÑË÷ÒýÇæÈÏΪԴ´úÂë ......

javaÓÅÐãµÄ³ÌÐòÔ±±Ø¶Á

 1¡¢Óï·¨£º±ØÐë±È½ÏÊìϤ£¬ÔÚд´úÂëµÄʱºòIDEµÄ±à¼­Æ÷¶ÔijһÐб¨´íÓ¦¸ÃÄܹ»¸ù¾Ý±¨´íÐÅÏ¢ÖªµÀÊÇʲôÑùµÄÓï·¨´íÎó²¢ÇÒÖªµÀÈκÎÐÞÕý¡£
    2¡¢ÃüÁ±ØÐëÊìϤJDK´øµÄһЩ³£ÓÃÃüÁî¼°Æä³£ÓÃÑ¡ÏÃüÁîÖÁÉÙÐèÒªÊìϤ£ºappletviewer¡¢ HtmlConverter¡¢jar¡¢ java¡¢javac¡¢javadoc¡¢javap¡¢javaw¡¢native2ascii ......

΢ÈíµÄпª·¢¹¤¾ßÄÜսʤjavaô

Ò»Ö±ÒÔÀ´¶¼ÊÇ΢ÈíµÄËÀÖÒ£¬ÎÒÒ»Ö±¹ÌÖ´µÄʹÓÃ×Å΢ÈíµÄ²úÆ·¡£´Ó2001Äêµ½½ñÄê2010Ä꣬ÒѾ­¶È¹ýÁË9ÄêµÄʱ¹â£¬¿´×ÅËüµÄ½ø²½£¬Ò²¿´µ½ÁËjava¶ÔËüµÄ²Ïʳ¡£´Ó×î³õ´ó¼Ò¶Ô΢ÈíÊÇ·ñÒ»Ö»¶À´ó£¬µ½ÏÖÔÚÎÒµ£ÐÄvsϵÁвúÆ·ÊÇ·ñ±»javaËùÍÌû¡£
Îҵĵ£ÐIJ»ÊÇûÓеÀÀí£¬ÉõÖÁÎÒΪÁ˼á³ÖÎÒµÄ΢Èí·Ïß¶ø·ÅÆúÁËÏÖÔڵŤ×÷¡£
ÔÚ×öСÐÍÏîÄ¿ºÍ×ÀÃæÐÍÏîÄ ......

javaѧϰ±Ê¼Ç 1.³õ²½½éÉÜ

Ò».javaÈý¸ö·½Ïò
j2se ×ÀÃæ¿ª·¢  £¨»ù´¡£©
j2ee web¿ª·¢
j2me ÊÖ»ú¿ª·¢
¶þ.¿ª·¢¹¤¾ß
¼Çʱ¾
jcreator
jbuilder
netbean
elipse£¨IBM£©
......
Èý.javaÓïÑÔÌØµã
¼òµ¥
ÃæÏò¶ÔÏó
¿çƽ̨£¨Ò»´Î±àÒ룬µ½´¦ÔËÐУ©
¸ßÐÔÄÜ
ËÄ.°²×°ºÍÅäÖÃjdk
jdk£¿
java development kit java¿ª·¢¹¤¾ß°ü
°üÀ¨£ºjre£¨javaÔËÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ