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

javaÏ̳߳صÄÔ­ÀíÓëʵÏÖ

javaÏ̳߳صÄÔ­ÀíÓëʵÏÖ



[·ÖÏí]Java Ï̳߳صÄÔ­ÀíÓëʵÏÖ2008-07-18
14:53------------------------------------------------------------------------------------------------
Õ⼸ÌìÖ÷ÒªÊÇ¿ñ¿´Ô´³ÌÐò£¬ÔÚÃÖ²¹ÁËһЩÒÔǰ֪ʶ¿Õ°×µÄͬʱ£¬Ò²Ñ§»áÁ˲»ÉÙеÄ֪ʶ£¨±ÈÈç NIO£©£¬»òÕß³ÆΪм¼Êõ°É¡£
Ï̳߳ؾÍÊÇÆäÖÐÖ®Ò»£¬Ò»Ìáµ½Ị̈߳¬ÎÒÃÇ»áÏëµ½ÒÔÇ°¡¶²Ù×÷ϵͳ¡·µÄÉú²úÕßÓëÏû·ÑÕߣ¬ÐźÅÁ¿£¬Í¬²½¿ØÖƵȵȡ£
Ò»Ìáµ½³Ø£¬ÎÒÃÇ»áÏëµ½Êý¾Ý¿âÁ¬½Ó³Ø£¬µ«ÊÇÏ̳߳ØÓÖÈçºÎÄØ£¿
½¨Ò飺ÔÚÔĶÁ±¾ÎÄÇ°£¬ÏÈÀíÒ»Àíͬ²½µÄ֪ʶ£¬ÌرðÊÇsyncronizedͬ²½¹Ø¼ü×ÖµÄÓ÷¨¡£
¹ØÓÚÎÒ¶Ôͬ²½µÄÈÏʶ£¬ÒªÔµÓÚ´óÈýÄêµÄÒ»±¾Ê飬ÊéÃûºÃÏñÊÇ Java ʵս£¬Õâ±¾ÊéдµÃʵÔÚÌ«ÃîÁË£¬ÕæÕýµÄ´ÓÀíÂÛµ½Êµ¼ù£¬´Ó½Øͼ·ÖÎöµ½.class×Ö½ÚÂë·ÖÎö¡£ÍÛ£¬ÎÒÏëÊг¡ÉϺÜÄÑÂòµ½Õâô¾«ÖµÄÊéÁË¡£×÷Ϊһ¸öJava°®ºÃÕߣ¬ÎÒ¾õµÃ¾ø¶ÔÖµµÃÒ»¶Á¡£
ÎÒ¶Ô´ËÊéÓ¡Ïó×îÉîÖ®Ò»µÄ¾ÍÊÇ£ºequal()·½·¨£¬ÓÉdzÈëÉ¾­µä£¡
»¹ÓоÍÊÇͬ²½ÁË£¬ÆäÖÐÌáµ½ÁËÎҵļ¸¸ö±à³ÌÎóÇø£¬ÒÔÇ°ÈçºÎʹÓÃͬ²½Ìá¸ßÐÔÄܵȵȣ¬Í¨¹ýѧϰ£¬Ê¹ÎÒ¶Ôͬ²½µÄÈÏʶ½øÒ»²½¼ÓÉî¡£
--------------------------------------------------------------------------------------------------
¼òµ¥½éÉÜ
    ´´½¨Ïß³ÌÓÐÁ½ÖÖ·½Ê½£º¼Ì³ÐThread»òʵÏÖRunnable¡£ThreadʵÏÖÁËRunnable½Ó¿Ú£¬ÌṩÁËÒ»¸ö¿ÕµÄrun()·½·¨£¬ËùÒÔ²»ÂÛÊǼ̳ÐThread»¹ÊÇʵÏÖRunnable£¬¶¼ÒªÓÐ×Ô¼ºµÄrun()·½·¨¡£
    Ò»¸öÏ̴߳´½¨ºó¾Í´æÔÚ£¬µ÷ÓÃstart()·½·¨¾Í¿ªÊ¼ÔËÐУ¨Ö´ÐÐrun()·½·¨£©£¬µ÷ÓÃwait½øÈëµÈ´ý»òµ÷ÓÃsleep½øÈëÐÝÃßÆÚ£¬Ë³ÀûÔËÐÐÍê±Ï»òÐÝÃß±»ÖжϻòÔËÐйý³ÌÖгöÏÖÒì³£¶øÍ˳ö¡£
waitºÍsleep±È½Ï£º
    sleep·½·¨ÓУºsleep(long millis)£¬sleep(long millis, long
nanos)£¬µ÷ÓÃsleep·½·¨ºó£¬µ±Ç°Ï߳̽øÈëÐÝÃßÆÚ£¬ÔÝÍ£Ö´ÐУ¬µ«¸ÃÏ̼߳ÌÐøÓµÓмàÊÓ×ÊÔ´µÄËùÓÐȨ¡£µ½´ïÐÝÃßʱ¼äºóÏ߳̽«¼ÌÐøÖ´ÐУ¬Ö±µ½Íê³É¡£ÈôÔÚ
ÐÝÃßÆÚÁíÒ»Ïß³ÌÖжϸÃỊ̈߳¬Ôò¸ÃÏß³ÌÍ˳ö¡£
    wait·½·¨ÓУºwait()£¬wait(long timeout)£¬wait(long timeout, long nanos)£¬µ÷ÓÃwait·½·¨ºó£¬¸ÃÏ̷߳ÅÆú¼àÊÓ×ÊÔ´µÄËùÓÐȨ½øÈëµÈ´ý״̬£»
      wait()£ºµÈ´ýÓÐÆäËüµÄÏ̵߳÷ÓÃnotify()»ònotifyAll()½øÈëµ÷¶È״̬£¬ÓëÆäËüÏ̹߳²Í¬Õù¶á¼àÊÓ¡£wait()Ï൱ÓÚwait(0)£¬wait(0, 0)¡£
      w


Ïà¹ØÎĵµ£º

javaÖÐStirngÀàµÄÉ

³£¿´µ½ºÜ¶àÈËÌÖÂÛjavaÖйØÓÚStringµÄÎÊÌâ,ÎÒÒ²¾ÍÓеãÐËȤÁË,¼øÓÚÍøÉϺܶàÈËдµÄ¶¼²î±ðºÜ´ó,
ͬÑùµÄÎÊÌⶼÊDz»Í¬µÄ˵·¨,ÎÒºÜÃÔºý,»¨ÁËÒ»ÍíÉ϶ÁÁËJava Virtual Machine SpecificationºÍ
The Java Language SpecificationµÄһЩÕ½Ú,×öÁ˺ܶàÊÔÑé,×ܽáÁËһϹØÓÚStringµÄÄÚÈÝ,»¹
ÓкܶàÄÚÈÝÎÒÒ²²»È·¶¨,ÔÚÏÂÃæÒ²¶¼Ìá³öÀ´ÁË,Ï ......

Java»ù´¡ÎÊÌ⣺java.lang.String

Ô­ÎÄ: http://forum.javaeye.com/viewtopic.php?t=17912§Ö÷µÄÎÊÌâÎʵĺ¬º¬ºýºý:flyjie¸ø³öÁ˷dz£ÏêϸµÄ½âÊÍ£¬²»¹ý¾ÍÊÇûÓнâÊÍStringʵÀý»¯µÄÌØÊâ·½ÃæÒÔ¼°Intern()·½·¨µÄº¬Òå----------------------------------------------------------------------------------------------------------------------------------------- ......

JAVA¶ÁÈ¡CSV

Ê×Ïȵ½¸Ãhttp://ostermiller.org/utils/download.html µØÖ·ÏÂÔØcom.Ostermiller.util cvsµÄjar°ü¡£
public class CsvFileParser{
private LabeledCSVParser csvParser;//csv½âÎöÆ÷£¬¶ÔÓÚµÚÒ»ÐеıíÍ·ÐÅÏ¢£¬×Ô¶¯¼ÓÔØΪË÷Òý¹Ø¼ü×Ö
private int currLineNum = -1;//ÎļþËù¶Áµ½ÐÐÊý
private String[] currLi ......

Java heap space³ö´íÔ­Òò[ת]

ʹÓÃJava³ÌÐò´ÓÊý¾Ý¿âÖвéѯ´óÁ¿µÄÊý¾ÝʱÈÝÒ׳öÏÖÒì³£:
java.lang.OutOfMemoryError: Java heap space
ÔÚJVMÖÐÈç¹û98£¥µÄʱ¼äÊÇÓÃÓÚGCÇÒ¿ÉÓÃµÄ Heap size ²»×ã2£¥µÄʱºò½«Å׳ö´ËÒì³£ÐÅÏ¢¡£
»¹ÓÐʹÓÃjxl¶ÁдexcelÎļþʱ£¬Í¬Ê±¶ÁÈëËùÓмǼ£¬Ò²ÈÝÒ׳öÏÖÕâ¸öÎÊÌâ¡£
JVM¶ÑµÄÉèÖÃÊÇÖ¸java³ÌÐòÔËÐйý³ÌÖÐJVM¿ÉÒÔµ÷ÅäʹÓõÄÄÚ ......

J2EE·Ö²ãÉè¼ÆÊÇJavaÆóÒµÓ¦ÓõÄ×î»ù±¾µÄÉè¼Æ˼Ïë¡£


 
´Ó×î³£¹æµÄ·Ö²ã½á¹¹À´Ëµ£¬ÏµÍ³²ã´Î´ÓÉϵ½ÏÂÒÀ´ÎΪ£º
 
±íÏֲ㣺Ö÷ÒªÊÇ¿Í»§¶ËµÄչʾ¡£
 
·þÎñ²ã£ºÖ±½ÓΪ¿Í»§¶ËÌṩµÄ·þÎñ»ò¹¦ÄÜ¡£Ò²ÊÇϵͳËùÄܶÔÍâÌṩµÄ¹¦ÄÜ¡£
 
ÁìÓò²ã£ºÏµÍ³ÄÚµÄÁìÓò»î¶¯¡£
 
DAO²ã£ºÊý¾Ý·ÃÎʶÔÏó£¬Í¨¹ýÁìÓòʵÌå¶ÔÏóÀ´²Ù×÷Êý¾Ý¿â¡£
 
ÆäÖÐÓÐЩָµ¼Ô­Ôò£º
& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ