|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
其实产生见解的过程就是训练自己发现问题,分析问题的能力。根据以上的认识我想谈下传统的学习与通过视频独立学习的优缺点:calendar|对照
importjava.text.DateFormat;importjava.util.*;
publicclassJspCalendar{Calendarcalendar=null;
publicJspCalendar(){calendar=Calendar.getInstance();DatetrialTime=newDate();calendar.setTime(trialTime);}
publicintgetYear(){returncalendar.get(Calendar.YEAR);}publicStringgetMonth(){intm=getMonthInt();String[]months=newString[]{"January","February","March","April","May","June","July","August","September","October","November","December"};if(m>12)return"UnknowntoMan";returnmonths[m-1];
}
publicStringgetDay(){intx=getDayOfWeek();String[]days=newString[]{"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
if(x>7)return"UnknowntoMan";
returndays[x-1];
}publicintgetMonthInt(){return1+calendar.get(Calendar.MONTH);}
publicStringgetDate(){returngetMonthInt()+"/"+getDayOfMonth()+"/"+getYear();
}
publicStringgetTime(){returngetHour()+":"+getMinute()+":"+getSecond();}
publicintgetDayOfMonth(){returncalendar.get(Calendar.DAY_OF_MONTH);}
publicintgetDayOfYear(){returncalendar.get(Calendar.DAY_OF_YEAR);}
publicintgetWeekOfYear(){returncalendar.get(Calendar.WEEK_OF_YEAR);}
publicintgetWeekOfMonth(){returncalendar.get(Calendar.WEEK_OF_MONTH);}
publicintgetDayOfWeek(){returncalendar.get(Calendar.DAY_OF_WEEK);}publicintgetHour(){returncalendar.get(Calendar.HOUR_OF_DAY);}publicintgetMinute(){returncalendar.get(Calendar.MINUTE);}
publicintgetSecond(){returncalendar.get(Calendar.SECOND);}
publicstaticvoidmain(Stringargs[]){JspCalendardb=newJspCalendar();p("date:"+db.getDayOfMonth());p("year:"+db.getYear());p("month:"+db.getMonth());p("time:"+db.getTime());p("date:"+db.getDate());p("Day:"+db.getDay());p("DayOfYear:"+db.getDayOfYear());p("WeekOfYear:"+db.getWeekOfYear());p("era:"+db.getEra());p("ampm:"+db.getAMPM());p("DST:"+db.getDSTOffset());p("ZONEOffset:"+db.getZoneOffset());p("TIMEZONE:"+db.getUSTimeZone());}
privatestaticvoidp(Stringx){System.out.println(x);}
publicintgetEra(){returncalendar.get(Calendar.ERA);}
publicStringgetUSTimeZone(){String[]zones=newString[]{"Hawaii","Alaskan","Pacific","Mountain","Central","Eastern"};returnzones[10+getZoneOffset()];}
publicintgetZoneOffset(){returncalendar.get(Calendar.ZONE_OFFSET)/(60*60*1000);}
publicintgetDSTOffset(){returncalendar.get(Calendar.DST_OFFSET)/(60*60*1000);}
publicintgetAMPM(){returncalendar.get(Calendar.AM_PM);}}
Java伴随着互联网的迅猛发展而发展,逐渐成为重要的网络编程语言。Oracle收购Sun后Java前途未卜。 |
|