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

JavaÖи²¸ÇÓëÖØÔصÄÇø±ð

     override¿ÉÒÔ·­ÒëΪ¸²¸Ç£¬´Ó×ÖÃæ¾Í¿ÉÒÔÖªµÀ£¬ËüÊǸ²¸ÇÁËÒ»¸ö·½·¨²¢ÇÒ¶ÔÆäÖØд£¬ÒÔÇó´ïµ½²»Í¬µÄ×÷Ó᣶ÔÎÒÃÇÀ´Ëµ×îÊìϤµÄ¸²¸Ç¾ÍÊǶԽӿڷ½·¨µÄʵÏÖ£¬ÔÚ½Ó¿ÚÖÐÒ»°ãÖ»ÊǶԷ½·¨½øÐÐÁËÉùÃ÷£¬¶øÎÒÃÇÔÚʵÏÖʱ£¬¾ÍÐèҪʵÏÖ½Ó¿ÚÉùÃ÷µÄËùÓз½·¨¡£³ýÁËÕâ¸öµäÐ͵ÄÓ÷¨ÒÔÍ⣬ÎÒÃÇÔڼ̳ÐÖÐÒ²¿ÉÄÜ»áÔÚ×ÓÀา¸Ç¸¸ÀàÖеķ½·¨¡£ÔÚ¸²¸ÇҪעÒâÒÔϵļ¸µã£º
    1¡¢¸²¸ÇµÄ·½·¨µÄ±êÖ¾±ØÐëÒªºÍ±»¸²¸ÇµÄ·½·¨µÄ±êÖ¾ÍêÈ«Æ¥Å䣬²ÅÄÜ´ïµ½¸²¸ÇµÄЧ¹û£»
    2¡¢¸²¸ÇµÄ·½·¨µÄ·µ»ØÖµ±ØÐëºÍ±»¸²¸ÇµÄ·½·¨µÄ·µ»ØÒ»Ö£»
    3¡¢¸²¸ÇµÄ·½·¨ËùÅ׳öµÄÒì³£±ØÐëºÍ±»¸²¸Ç·½·¨µÄËùÅ׳öµÄÒì³£Ò»Ö£¬»òÕßÊÇÆä×ÓÀࣻ
    4¡¢±»¸²¸ÇµÄ·½·¨²»ÄÜΪprivate£¬·ñÔòÔÚÆä×ÓÀàÖÐÖ»ÊÇж¨ÒåÁËÒ»¸ö·½·¨£¬²¢Ã»ÓжÔÆä½øÐи²¸Ç¡£
     overload¶ÔÎÒÃÇÀ´Ëµ¿ÉÄܱȽÏÊìϤ£¬¿ÉÒÔ·­ÒëΪÖØÔØ£¬ËüÊÇÖ¸ÎÒÃÇ¿ÉÒÔ¶¨ÒåһЩÃû³ÆÏàͬµÄ·½·¨£¬Í¨¹ý¶¨Ò岻ͬµÄÊäÈë²ÎÊýÀ´Çø·ÖÕâЩ·½·¨£¬È»ºóÔÙµ÷ÓÃʱ£¬VM¾Í»á¸ù¾Ý²»Í¬µÄ²ÎÊýÑùʽ£¬À´Ñ¡ÔñºÏÊʵķ½·¨Ö´ÐС£ÔÚʹÓÃÖØÔØҪעÒâÒÔϵļ¸µã£º
    1¡¢ÔÚʹÓÃÖØÔØʱֻÄÜͨ¹ý²»Í¬µÄ²ÎÊýÑùʽ¡£ÀýÈ磬²»Í¬µÄ²ÎÊýÀàÐÍ£¬²»Í¬µÄ²ÎÊý¸öÊý£¬²»Í¬µÄ²ÎÊý˳Ðò£¨µ±È»£¬Í¬Ò»·½·¨Äڵļ¸¸ö²ÎÊýÀàÐͱØÐë²»Ò»Ñù£¬ÀýÈç¿ÉÒÔÊÇfun(int, float)£¬ µ«ÊDz»ÄÜΪfun(int, int)£©£»
    2¡¢²»ÄÜͨ¹ý·ÃÎÊȨÏÞ¡¢·µ»ØÀàÐÍ¡¢Å׳öµÄÒì³£½øÐÐÖØÔØ£»
    3¡¢·½·¨µÄÒì³£ÀàÐͺÍÊýÄ¿²»»á¶ÔÖØÔØÔì³ÉÓ°Ï죻
    ÏÂÃæÊǶÔoverrideºÍoverloadµÄ²âÊÔ³ÌÐò£¬ÆäÖÐ×¢ÊÍÖеÄÄÚÈݶ¼ÊÇ»á²úÉú±àÒë´íÎóµÄ´úÂ룬ÎÒÃǽ«×¢ÊÍÈ¥µô£¬¿´¿´ÔÚ±àÒëʱ»á²úÉúʲôЧ¹û¡£
// ¶Ôoverload²âÊÔµÄÎļþ£ºOverloadTest.java
public class OverloadTest {
// ÏÂÃ漸¸ö·½·¨ÓÃÀ´ÑéÖ¤¿ÉÒÔͨ¹ý¶¨Ò岻ͬµÄ²ÎÊýÀàÐͺͲÎÊýµÄÊýÄ¿½øÐз½·¨ÖØÔØ¡£
public void fun(){
System.out.println("method fun in OverloadTest, no parameter");
}
public void fun(float f) {
System.out.println("method fun in OverloadTest, parameter type: float");
}

public void fun(int i){
System.out.println("method fun in OverloadTest, parameter type: int");
}
public void fun(int i1, int i2) {
System.out.println("method fun in OverloadTest, paramet


Ïà¹ØÎĵµ£º

Java count down

public static void main(String[] args){
SimpleDateFormat da = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Calendar calendar = Calendar.getInstance();
Date date = calendar.getTime();
String aimTime ="2010-02-03 17:30:00.000";
int count = 0;
Date aimDate = d ......

¡¶Effective Java¡·: ¿¼ÂÇÓþ²Ì¬¹¤³§·½·¨´úÌæ¹¹Ô캯Êý

¿¼ÂÇÓþ²Ì¬¹¤³§·½·¨´úÌæ¹¹Ô캯Êý
Àà¿ÉÒÔΪËüµÄ¿Í»§ÌṩһЩ¾²Ì¬¹¤³§·½·¨£¬À´Ìæ´ú¹¹Ô캯Êý£¬»òÕßͬʱҲÌṩһЩ¹¹Ô캯Êý¡£
 ¾²Ì¬¹¤³§·½·¨µÄÒ»¸öºÃ´¦ÊÇ£¬Óë¹¹Ô캯ÊýÏà±È£¬¾²Ì¬¹¤³§·½·¨¾ßÓÐÃû×Ö£¬Ëü¿ÉÒÔʹµÃ´úÂë¸üÈÝÒ×ÔĶÁ¡£Èç¹ûÒ»¸öÀà¿´ÆðÀ´ÐèÒª¶à¸ö¹¹Ô캯Êý£¬²¢ÇÒËüÃǵÄÔ­ÐÍÌØÕ÷Ïàͬ£¬ÄÇôÄãÓ¦¸Ã¿¼ÂÇÓþ²Ì¬¹¤³§·½·¨À´ ......

ÀûÓÃJAVA²Ù×÷EXCELÎļþ


תÔØ×Ô£ºwww.csdn.net
2003 Äê 1 ÔÂ
ÔÚ¿ªÔ´ÊÀ½çÖУ¬ÓÐÁ½ÌױȽÏÓÐÓ°ÏìµÄAPI¿É¹©Ê¹Óã¬Ò»¸öÊÇPOI£¬Ò»¸öÊÇjExcelAPI¡£ÆäÖÐjExcelAPIÊÇÒ»¸öº«¹ú³ÌÐòÔ±µÄ×÷Æ·£¬ËäȻûÓÐPOIÄÇÑùѪͳ¸ß¹ó£¬µ«ÊÇÔÚ±ÊÕßµÄʹÓùý³ÌÖУ¬¸Ð¾õ¼òµ¥·½±ã£¬¶ÔÖÐÎÄÖ§³Ö·Ç³£ºÃ£¬¹¦ÄÜÒ²±È½ÏÇ¿´ó¡£ËüµÄÏÂÔصØÖ·ÊÇ£ºhttp://www.andykhan.com/jexcelapi/ µ±Ç ......

JavaÖÐÈÃCPU±£³ÖÔÚÒ»ÌõÖ±ÏßÉÏ


 /**
  * @param args
  */
 public static void main(String[] args) {
  long time1 = System.currentTimeMillis();
  long time2 = System.currentTimeMillis();
  while (true) {
   while ((time1 - time2) < 30)
   & ......

JavaµÄһЩ»ã×Ü

1.//propertyÎļþµÄ¶ÁÈ¡
//com.test.messageÎļþ
package com.test;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Test_Messages {
private static final String BUNDLE_NAME = "com.test.messages";
private static final ResourceBundle RESOURCE_BUNDLE = Reso ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ