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

JavaÖеĶÔÏó³Øģʽ

JavaÖеĶÔÏó³Øģʽ
Java¶ÔÏóµÄÉúÃüÖÜÆÚ·ÖÎö£º
Java¶ÔÏóµÄÉúÃüÖÜÆÚ´óÖ°üÀ¨Èý¸ö½×¶Î£º
¶ÔÏóµÄ´´½¨£¬¶ÔÏóµÄʹÓ㬠¶ÔÏóµÄÇå³ý¡£ Òò´Ë£¬¶ÔÏóµÄÉúÃüÖÜÆÚ³¤¶È¿ÉÓÃÈçϵıí´ïʽ±íʾ£º T = T1 + T2 + T3.ÆäÖÐT1±íʾ¶ÔÏóµÄ´´½¨Ê±¼ä£¬T2±íʾ¶ÔÏóµÄʹÓÃʱ¼ä£¬¶øT3Ôò±íʾ¶ÔÏóµÄÇå³ýʱ¼ä¡£ÓÉ´Ë£¬ÎÒÃÇ¿ÉÒÔ¿´³ö£¬Ö»ÓÐT2ÊÇÕæÕýÓÐЧµÄʱ¼ä£¬¶øT1,T3ÔòÊǶÔÏó±¾ÉíµÄ¿ªÏú¡£ÏÂÃæÔÙ¿´¿´T1, T3ÔÚ¶ÔÏóµÄÕû¸öÉúÃüÖÜÆÚÖÐËùÕ¼µÄ±ÈÀý¡£
ÎÒÃÇÖªµÀ£¬Java¶ÔÏóÊÇͨ¹ý¹¹Ô캯ÊýÀ´´´½¨µÄ£¬ÔÚÕâÒ»¹ý³ÌÖУ¬¸Ã¹¹Ô캯ÊýÁ´ÖеÄËùÓй¹Ô캯ÊýÒ²¶¼»á±»×Ô¶¯µ÷Óá£ÁíÍ⣬ĬÈÏÇé¿öÏ£¬µ÷ÓÃÀàµÄ¹¹Ô캯Êýʱ£¬Java»á°Ñ±äÁ¿³õʼ»¯³ÉÈ·¶¨µÄÖµ£ºËùÓеĶÔÏñ±»ÉèÖóÉnull,ÕûÊý±äÁ¿(byte, short, int , long)ÉèÖóÉ0£¬floatºÍdouble±äÁ¿ÉèÖóÉ0.0£¬Âß¼­ÖµÉèÖóÉfalse,ËùÒÔÓÃnew¹Ø¼ü×ÖÀ´Ð½¨Ò»¸ö¶ÔÏóµÄʱ¼ä¿ªÏúÊǺܴóµÄ£¬Èç±í1Ëùʾ¡£
±í1 һЩ²Ù×÷ËùÏûºÄµÄʱ¼äµÄ¶ÔÕÕ±í
ÔËËã²Ù×÷
ʾÀý
±ê×¼»¯Ê±¼ä
±¾µØ¸³Öµ
i = n
1.0
ʵÀý¸³Öµ
this.i = n
1.2
·½·¨µ÷ÓÃ
Funct()
5.9
н¨¶ÔÏó
New Object()
980
н¨Êý×é
New int[10]
3100
 
´Ó±íÒ»¿ÉÒÔ¿´³ö£¬Ð½¨Ò»¸ö¶ÔÏóÐèÒªµÄ980¸öµ¥Î»µÄʱ¼ä£¬ÊDZ¾µØ¸³ÖµÊ±¼äµÄ980±¶£¬ÊÇ·½·¨µ÷ÓÃʱ¼äµÄ166±¶£¬¶øÈôн¨Ò»¸öÊý×éËù»¨·ÑµÄʱ¼ä¾Í¸ü¶àÁË¡£
ÔÙ¿´Çå³ý¶ÔÏóµÄ¹ý³Ì¡£ÎÒÃÇÖªµÀ£¬JavaÓïÑÔµÄÒ»¸öÓÅÊÆ£¬¾ÍÊÇJava³ÌÐòÔ±²»ÐèÒªÏñC/C++³ÌÐòÔ±ÄÇÑù£¬ÏÔʽµØÊͷŶÔÏ󣬶øÓɳÆΪÀ¬»øÊÕ¼¯Æ÷(Garbage Colletor)µÄ×Ô¶¯ÄÚ´æ¹ÜÀíϵͳ£¬¶¨Ê±»òÄÚ´æ͹ÏÔ²»×ãʱ£¬×Ô¶¯»ØÊÕÀ¬»ø¶ÔÏóËùÕ¼µÄÄÚ´æ¡£·²ÊÂÓÐÀû×ÜÒ²Óбף¬ÕâËäȻΪJava³ÌÐòÔ±Éè¼ÆÕßÌṩÁ˼«´óµÄ·½±ã£¬µ«Í¬Ê±ËüÒ²´øÀ´Á˽ϴóµÄÐÔÄÜ¿ªÏú¡£ÕâÖÖ¿ªÏú°üÀ¨Á½·½Ã棺Ê×ÏÈÊǶÔÏó¹ÜÀíµÄ¿ªÏú£¬GCΪÁËÄܹ»ÕýÈ·ÊͷŶÔÏó£¬Ëü±ØÐë¼à¿Øÿһ¸ö¶ÔÏóµÄÔËÐÐ״̬£¬°üÀ¨¶ÔÏóµÄÉêÇë¡¢ÒýÓᢱ»ÒýÓᢸ³ÖµµÈ¡£Æä´Î£¬ÔÚGC¿ªÊ¼»ØÊÕ”À¬»ø”¶ÔÏóʱ£¬ÏµÍ³»áÔÝÍ£Ó¦ÓóÌÐòµÄÖ´ÐУ¬¶ø¶ÀÕ¼CPU.Òò´Ë£¬Èç¹ûÒª¸ÄÉÆÓ¦ÓóÌÐòµÄÐÔÄÜ£¬Ò»·½ÃæÓ¦¾¡Á¿¼õÉÙ´´½¨¶ÔÏóµÄ´ÎÊý£»Í¬Ê±£¬»¹Ó¦¾¡Á¿¼õÉÙT1,T3µÄʱ¼ä¡£¶øÕâЩ¾ù¿ÉÒÔͨ¹ý¶ÔÏó³Ø¼¼ÊõÀ´ÊµÏÖ¡£
¶ÔÏó³Ø¼¼ÊõµÄ»ù±¾Ô­Àí£º ¶ÔÏó³Ø¼¼Êõ»ù±¾Ô­ÀíµÄºËÐÄÓÐÁ½µã£º»º´æºÍ¹²Ïí£¬¼´¶ÔÓÚÄÇЩ±»Æµ·±Ê¹ÓõĶÔÏó£¬ÔÚʹÓÃÍêºó£¬²»Á¢¼´½«ËüÃÇÊÍ·Å£¬¶øÊǽ«ËüÃÇ»º´æÆðÀ´£¬ÒÔ¹©ºóÐøµÄÓ¦ÓóÌÐòÖظ´Ê¹Ó㬴Ӷø¼õÉÙ´´½¨¶ÔÏóºÍÊͷŶÔÏóµÄ´ÎÊý£¬½ø¶ø¸ÄÉÆÓ¦ÓóÌÐòµÄÐÔÄÜ¡£ÊÂʵÉÏ£¬ÓÉÓÚ¶ÔÏó³Ø¼¼Êõ½«¶ÔÏóÏÞÖÆÔÚÒ»¶¨µÄÊýÁ¿£¬Ò²ÓÐЧµØ¼


Ïà¹ØÎĵµ£º

Java·ºÐ;Žë

1¡¢²»¿ÉÒÔÓÃÒ»¸ö±¾µØÀàÐÍ£¨Èçint   float£©À´Ìæ»»·ºÐÍ
2¡¢ÔËÐÐʱÀàÐͼì²é£¬²»Í¬ÀàÐ͵ķºÐÍÀàÊǵȼ۵ģ¨Pair<String>ÓëPair<Employee>ÊÇÊôÓÚͬһ¸öÀàÐÍPair£©£¬
     ÕâÒ»µãÒªÌرð×¢Ò⣬¼´Èç¹ûa instanceof Pair<String>==trueµÄ»°£¬²¢²»´ú±ía.getFirst()µÄ·µ»ØÖµÊÇÒ»¸öS ......

Java 7ÒѾ­Íê³ÉµÄÆß´óй¦ÄÜÔ¤ÀÀ

Java 7ÒѾ­Íê³ÉµÄ7´óй¦ÄÜ£º
1£©¶Ô¼¯ºÏÀàµÄÓïÑÔÖ§³Ö£»
2£©×Ô¶¯×ÊÔ´¹ÜÀí£»
3£©¸Ä½øµÄͨÓÃʵÀý´´½¨ÀàÐÍÍƶϣ»
4£©Êý×Ö×ÖÃæÁ¿Ï»®ÏßÖ§³Ö£»
5£©switchÖÐʹÓÃstring£»
6£©¶þ½øÖÆ×ÖÃæÁ¿£»
7£©¼ò»¯¿É±ä²ÎÊý·½·¨µ÷Óá£
ÏÂÃæÎÒÃÇÀ´×Ðϸ¿´Ò»ÏÂÕâ7´óй¦ÄÜ£º
¶Ô¼¯ºÏÀàµÄÓïÑÔÖ§³Ö
Java½«°üº¬¶Ô´´½¨¼¯ºÏÀàµÄµÚÒ»ÀàÓïÑÔÖ§³Ö¡ ......

ÓÃjavaʵÏֵĵü´úºÍµÝ¹é²åÈëÅÅÐò

ÏÂÃæʹÓÃÒ»¸öjavaʵÏֵĵü´ú°æµÄµÝ¹é°æµÄ²åÈëÅÅÐò¡£
package sort;
import java.util.Date;
import java.util.Random;
/*
* ²åÈëÅÅÐò
*/
public class InsertSort{
public static void main(String args[])
{
int len = 20;
Date date = new Date();
Random random = new Random(date.getSeconds()); ......

Java Reflection dzÎö2

inner classºÍouter classÖ®¼äµÄreflectionÓ¦Óá£
package com.gaoqian.reflection;
import java.lang.reflect.Field;  
import java.lang.reflect.Modifier;  
import java.lang.reflect.Constructor;  
import java.lang.reflect.Method;  
 
class IncludeInn ......

JAVA BOT³ÌÐòÄ£ÄâÈËÀàÓû§Ìîд±íµ¥ ²¢ ·¢ËÍ

·ÂÕæ±íµ¥£ºBOT³ÌÐòÄ£ÄâÈËÀàÓû§Ìîд±íµ¥ ²¢ ·¢ËÍ
ץȡ±íµ¥£º
HTTPSocket http = new HTTPSocket();
SocketFactory.setProxyHost("openproxy.huawei.com");
SocketFactory.setProxyPort(8080);
HTMLPage page = new HTMLPage(http);
page.open("http://passport.csdn.net/UserLogin.aspx", null);
Vector vec = page. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ