Java Calendar »ñÈ¡±¾ÖÜÖÜÒ»ºÍÖÜÈÕ´úÂë
/**
* µÃµ½±¾ÖÜÖÜÒ»
*
* @return yyyy-MM-dd
*/
public static String getMondayOfThisWeek() {
Calendar c = Calendar.getInstance();
int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
if (day_of_week == 0)
day_of_week = 7;
c.add(Calendar.DATE, -day_of_week + 1);
return df2.format(c.getTime());
}
/**
* µÃµ½±¾ÖÜÖÜÈÕ
*
* @return yyyy-MM-dd
*/
public static String getSundayOfThisWeek() {
Calendar c = Calendar.getInstance();
int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
if (day_of_week == 0)
day_of_week = 7;
c.add(Calendar.DATE, -day_of_week + 7);
return df2.format(c.getTime());
}
Ïà¹ØÎĵµ£º
java ÐÞÊηûºÍ·ÃÎÊȨÏÞ½éÉÜ
ÐÞÊηû½éÉÜ£º
public
ʹÓöÔÏó:Àà¡¢½Ó¿Ú¡¢³ÉÔ±±äÁ¿¡¢·½·¨
½éÉÜ:ÎÞÂÛËüËù´¦ÔÚ°ü¶¨ÒåÔÚÄĸÃÀà(½Ó¿Ú¡¢³ÉÔ±)¶¼ÊǿɷÃÎÊ
protected
ʹÓöÔÏó:³ÉÔ±±äÁ¿¡¢·½·¨
½éÉÜ:³ÉÔ±±äÁ¿Ö»ÄÜÔÚ¶¨ÒåËü°üÖб»·ÃÎÊ£¬Èç¹ûÔÚÆäËû°üÖб»·ÃÎÊ£¬ÔòʵÏÖÕâ¸ö˼··½·¨Àà±ØÐëÊǸóÉÔ±ËùÊôÀà×ÓÀà
private
ʹÓöÔÏó:³É ......
Ê×ÏÈÃ÷ȷһϣºjavaÀïÃæÖ»ÓÐÖµ´«µÝ£¬ÒýÓô«µÝÖ»ÊÇÒ»Ö»Îó¶Á¶øÒÑ¡£
À´¿´Ò»¸öÀý×Ó£º
public static void main(String[] args)
{
StringBuffer str1 = new StringBuffer("hello");
test(str1);
System.out.println("main : " + str1);
}
public static void test(StringBuffer s ......
(×îÖÕ»¹ÊǾö¶¨ÖØÐÂдһ·ÝJava»ù´¡Ïà¹ØµÄÄÚÈÝ£¬ÔÀ´ÒòΪÔÚдÕâÒ»¸öÕ½ڵÄʱºòûÓп¼Âǵ½»á¼á³ÖÍùºó±ßд£¬Õâ´ÎÓ¦¸ÃÊǸüиÃÄÚÈÝ¡£¶øÇÒºÜÌÖÑáд»ù´¡µÄ¶«Î÷£¬ÄÚÈݱȽÏËöË飬¶øÇÒÕûÀíÆðÀ´×Ü»áºÜ¶à£¬ÓпÉÄÜ»á´òÉ¢³ÉÁ½¸öÕ½ڣ¬µ«ÊÇÎÒ²»±£Ö¤£¬ÓпÉÄÜÒ»¸öÕ½ھÍдÍêÁË£¬ËùÒÔÓÐʱºòÏ£Íû»ù´¡µÄºÜ¶àÄÚÈÝ»¹ÊǶÁÕß×Ô¼ºÈ¥¿´¿´£¬ÎÒ»ù± ......
Java¶ÔÏó¼°ÒýÓÃ
Java¶ÔÏó¼°ÒýÓÃÊÇÈÝÒ×»ìÏýÈ´ÓÖ±ØÐëÕÆÎյĻù´¡ÖªÊ¶£¬±¾Õ²ûÊöJava¶ÔÏóºÍÒýÓõĸÅÄÒÔ¼°ÓëÆäÃÜÇÐÏà¹ØµÄ²ÎÊý´«µÝ¡£
ÏÈ¿´ÏÂÃæµÄ³ÌÐò£º
StringBuffer s;
s = new StringBuffer("Hello World!");
µÚÒ»¸ö ......
//Îå¸öÀà
--|fileÀֱࣺ½ÓÓëÎļþ±¾ÉíÓйØÏµ
--|×Ö½ÚÁ÷ OutputStream InputStream
--|×Ö·ûÁ÷ Writer Reader
´æ·ÅÔÚÎļþÖеͼÊÇ×Ö½Ú¡£¶ø¶Áµ½ÄÚ´æÖвſÉÄܱä³É×Ö·û
´òÓ¡Á÷£ºprintStream/PrintWriter:ÌṩÁ˸÷ÖÖ´òÓ¡¹¦ÄÜ£¬¿ÉÒÔÊä³öÈÎÒâµÄÄÚÈÝ£¬¸ù¾ÝʵÀý»¯¶ÔÏóµÄ²»Í¬
Êä³öµÄλÖÃÒ²²»Í¬
package java11.I ......