JAVA±¨±íÁ½ÈÕÆÚ¼äÔ£¬ÖÜ£¬ÈÕ¼ÆËã
//¼ÆËãÌìÊý
public List day(String dates,String datee) throws ParseException{
List dayls=new ArrayList();
// ×Ö·û´®×ª»»³ÉÈÕÆÚ
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = format.parse(dates);
Calendar startTime = Calendar.getInstance();
startTime.clear();
startTime.setTime(startDate);
int startYear = startTime.get(Calendar.YEAR);
int startMonth = startTime.get(Calendar.MONTH);
int startDay = startTime.get(Calendar.DAY_OF_MONTH);
Date endDate = format.parse(datee);
Calendar endTime = Calendar.getInstance();
endTime.clear();
endTime.setTime(endDate);
int endYear = endTime.get(Calendar.YEAR);
int endMonth = endTime.get(Calendar.MONTH);
int endDay = endTime.get(Calendar.DAY_OF_MONTH);
int count = 0;
for (int x = startYear; x <= endYear; x++) {
// ÂÞÂíÀú·¨²úÉúÄê·Ý¹«Ôª1582Äê
int gregorianCutoverYear = 1582;
// ÅжÏÊÇ·ñÊÇÈòÄê
boolean isLeapYear = x >= gregorianCutoverYear ? ((x % 4 == 0) && ((x % 100 != 0) || (x % 400 == 0)))
: (x % 4 == 0);
// »ñÈ¡¿ªÊ¼ÔµÄ×î´óÌìÊý£»´óÔÂÊÇ1£¬3£¬5£¬7£¬8£¬10£¬12£»Ð¡ÔÂÊÇ4£¬6£¬9£¬11£»ÌØÊâÔÂÊÇ2
int max = 0;
if (startMonth == 1) {
if (isLeapYear) {
max = 29;
}
if (!isLeapYear) {
max = 28;
}
}
if (startMonth == 3 || startMonth == 5 || startMonth == 8
|| startMonth == 10) {
max = 30;
}
if (startMo
Ïà¹ØÎĵµ£º
InetAddressÀà´ú±íIPµØÖ·£¬ÓÐÁ½¸ö×ÓÀ࣬Inet4Address£¬Inet6Address´ú±íIPV4ºÍIPv6£¬Ã»Óй¹Ôì·½·¨£¬µ«ÊÇÌṩ¸öÁËÁ½¸ö¾²Ì¬·½·¨À´»ñÈ¡InetAddressʵÀý£ºgetByName(String host):¸ù¾ÝÖð¾ä»ñÈ¡¶ÔÓ¦µÄInetAddress¶ÔÏó£»getByAddress(byte[]addr):¸ù¾ÝÔʼIPµØÖ·À´»ñÈ¡¶ÔÓ¦µÄInetAddress¶ÔÏ ......
FileÀà
´´½¨Ä¿Â¼£¬ÓÃmkdirºÍmkdirsµÄº¯Êý
public boolean mkdir():´´½¨´Ë³éÏó·¾¶ÃûÖ¸¶¨µÄĿ¼¡£
public boolean mkdirs():´´½¨´Ë³éÏó·¾¶ÃûÖ¸¶¨µÄĿ¼£¬°üÀ¨ËùÓбØÐ赫²»´æÔڵĸ¸Ä¿Â¼¡£×¢Ò⣬´Ë²Ù×÷ʧ°ÜʱҲ¿ÉÄÜÒѾ³É¹¦µØ´´½¨ÁËÒ»²¿·Ö±ØÐèµÄ¸¸Ä¿Â¼¡£
mkdirÀý×Ó£º
File dir = new File("E:/mydir/");
if(!di ......
Õ⼸ÌìÒ»Ö±ÔÚ¸ã¹ØÓÚÓÅÏȼ¶¶ÓÁеÄʵÏÖ,ÒòΪҪ¿¼Âǵ½Ï̵߳ݲȫ,ËùÒÔPriorityQueue¾Í²»ÊÊÓÃÁË¡£Ò»¸ö·Ç³£¼òµ¥µÄʵÏÖ·½
·¨£¬ÄǾÍÊǰÑÓÅÏȼ¶±È½ÏºÃµÄ²åÈëÒ»¸ö¶ÓÁУ¬ÓÅÏȼ¶µÍµÄ²åÈëÁíÒ»¸ö¶ÓÁУ¬È¡ÊýµÄʱºòÏÈÔÚÓÅÏȼ¶¸ßµÄ¶ÓÁÐÉÏÈ¡Êý¡£ÕâÓиöȱµã¾ÍÊÇÈç¹ûÓÅÏȼ¶±ðÔ½¶àµÄ»°£¬¶ÓÁ ......
public class MyEclipseGen {
private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up ......