1.¼ÆËãijһÔ·ݵÄ×î´óÌìÊý
Calendar time=Calendar.getInstance();
time.clear();
time.set(Calendar.YEAR,year); //year Ϊ int
time.set(Calendar.MONTH,i-1);//×¢Òâ,Calendar¶ÔÏóĬÈÏÒ»ÔÂΪ0
int day=time.getActualMaximum(Calendar.DAY_OF_MONTH);//±¾Ô·ݵÄÌìÊý
×¢£ºÔÚʹÓÃset·½·¨Ö®Ç°£¬±ØÐëÏÈclearһϣ¬·ñÔòºÜ¶àÐÅÏ¢»á¼Ì³Ð×Ôϵͳµ±Ç°Ê±¼ä
2.CalendarºÍDateµÄת»¯
(1) Calendarת»¯ÎªDate
Calendar cal=Calendar.getInstance();
Date date=cal.getTime();
(2) Dateת»¯ÎªCalendar
Date date=new Date();
Calendar cal=Calendar.getInstance();
cal.setTime(date);
3.¸ñʽ»¯Êä³öÈÕÆÚʱ¼ä £¨Õâ¸öÓõıȽ϶ࣩ
Date date=new Date();
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String time=df.format(date);
System.out.println(time);
4.¼ÆËãÒ»ÄêÖеĵڼ¸ÐÇÆÚ
(1)¼ÆËãijһÌìÊÇÒ»ÄêÖеĵڼ¸ÐÇÆÚ
Calendar cal=Calendar.getInstance();
cal.set(Calendar.YEAR, 2006);
cal.set(Calendar.MONTH,9);
cal.set(Calendar.DAY_OF_MONT ......
(Ô´´)ÉîÈëÑо¿java¶ÔString×Ö·û´®¶ÔÏóµÄ´´½¨ÒÔ¼°¹ÜÀí
(2008-9-27 bbh)
ÐÂÊÖ³õѧ,²»¶ÔµÄµØ·½´ó¼Ò¶à¶àÖ¸½Ì~
¾³£¿´µ½ºÜ¶àÈËÌÖÂÛjavaÖйØÓÚStringµÄÎÊÌâ,ÎÒÒ²¾ÍÓеãÐËȤÁË,¼øÓÚÍøÉϺܶàÈËдµÄ¶¼²î±ðºÜ´ó,
ͬÑùµÄÎÊÌⶼÊDz»Í¬µÄ˵·¨,ÎÒºÜÃÔºý,»¨ÁËÒ»ÍíÉ϶ÁÁËJava Virtual Machine SpecificationºÍ
The Java Language SpecificationµÄһЩÕ½Ú,×öÁ˺ܶàÊÔÑé,×ܽáÁËһϹØÓÚStringµÄÄÚÈÝ,»¹
ÓкܶàÄÚÈÝÎÒÒ²²»È·¶¨,ÔÚÏÂÃæÒ²¶¼Ìá³öÀ´ÁË,Ï£Íû¸ßÊÖÄÜÖ¸Õý.
Constant Pool³£Á¿³ØµÄ¸ÅÄî:
ÔÚ½²µ½StringµÄһЩÌØÊâÇé¿öʱ,×Ü»áÌáµ½String Pool»òÕßConstant Pool,µ«ÊÇÎÒÏëºÜ¶àÈ˶¼²»Ì«
Ã÷°×Constant Poolµ½µ×ÊǸöÔõôÑùµÄ¶«Î÷,ÔËÐеÄʱºò´æ´¢ÔÚÄÄÀï,ËùÒÔÔÚÕâÀïÏÈ˵һÏÂConstant PoolµÄÄÚÈÝ.
String PoolÊǶÔÓ¦ÓÚÔÚConstant PoolÖд洢String³£Á¿µÄÇøÓò.Ï°¹ß³ÆΪString Pool,Ò²ÓÐÈ˳ÆΪ
String Constant Pool.ºÃÏñûÓÐÕýʽµÄÃüÃû??
ÔÚjava±àÒëºÃµÄclassÎļþÖÐ,ÓиöÇøÓò³ÆΪConstant Pool,ËûÊÇÒ»¸öÓÉÊý×é×é³ÉµÄ±í,ÀàÐÍ
Ϊcp_info constant_pool[],ÓÃÀ´´æ´¢³ÌÐòÖÐʹÓõĸ÷ÖÖ³£Á¿,°üÀ¨Class/String/IntegerµÈ¸÷
ÖÖ»ù±¾JavaÊý¾ÝÀàÐÍ,ÏêÇé²Î¼ûThe Java Virtual Machine Specification ......
´«ÖDz¥¿ÍJAVAÅàѵstruts2ѧϰ±Ê¼Ç Ç°Á½ÌìÎÒÏÝÈëÁËstruts2ÔÀíµÄÄàÌ·Öв»¿É×Ô°ÇÁË£¬ÕâÖָоõÏ൱²»´í£¬µ«ÊÇÎÒ¸öÈË»¹ÊǸоõ»ù´¡Èç¹û²»ÊǺܺõĻ°£¬Ç§Íò²»ÒªÏÝÈ룬ÒòΪÕâÑùµÄ»°£¬ºÜÓпÉÄÜÈÃÒ»¸öÈ˱äµÃûÓÐÐÅÐÄ£¬»¹ºÃÎÒÊÇÒ»¸öÐÄÀí»¹´í²»´íµÄÈË£¬ËùÒԺܿì¾Í×ßÁ˳öÀ´¡£ËùÒÔ£¬ÎҵĸöÈ˸оõ»¹ÊÇ£¬ÏÈÕÆÎÕ»ù´¡£¬È»ºóÔÚÈ¥Àí½âÔÀí°É£¬Ò»µ©Éæ¼°µ½Ô´úÂ룬ÕâÉÏǧÐеĴúÂë»á°ÑÄã¸ãµÃÔÎͷתÏò£¬ÒòΪ¶ÔÓÚ³õѧÕßÀ´Ëµ£¬Èç¹ûÄãûÓÐÕÆÎÕÆäÖеÄÁ÷³ÌÄã¾Í²»¿ÉÄÜÓеķÅʧµÄȥѧϰ¶«Î÷¡£Èç¹û²úÉúÁ˸ºÃæµÄÇéÐ÷£¬Ç§ÍòÒªºÃºÃµÄµ÷Õû×Ô¼º£¬ÃâµÃºÍÎÒ֮ǰ×öEMSÏîÄ¿Ò»Ñù£¬µ«ÊÇ£¬Ëùν¹¦·ò²»¸ºÓÐÐÄÈ˺ǣ¬×îÖÕÎÒ»¹ÊÇͦ¹ýÁËÕâ¸öÄѹأ¬Í¨¹ýÁ¬ÐøN¶àÌìµÄ°¾Ò¹¼Ó°à¼Óµã,ÖÕÓÚ¸úÉÏÁËÀÏʦµÄ½ø³Ì.ͬ־ÃÇ,¼ÓÓÍ!Ƚƽµ±È»Ò²Òª¼ÓÓÍ,ÎÒͬÉÏ°àÈ¥ÁËÓ´,¹¤×ÊËäÈ»²»¸ß,4K,µ«¶ÔÓÚÎÒÏÖÔڵĽ׶ÎÀ´Ëµ,Èç¹ûÊÇÎÒ,ÎÒ¾ÍÂú×ãÁË! ·ÃÎÊrequest/session/applicationÊôÐÔ 1.½«Öµ´æÈ벻ͬµÄ×÷ÓÃÓòÖУº ActionContext ac = ActionContext.getContext(); ac.getSession().put("testSession","testSession1" ); ac.getApplication().put("testApplication","testApplication1"); ac.put("testRequest", "testRequest1"); ÔÚÒ³ÃæÖзÃÎÊ: ${testRequest } $ ......
ÔËÓüÓÃܼ¼Êõ±£»¤JavaÔ´´úÂë
ÄÚÈÝ£º
Ò»¡¢ÎªÊ²Ã´Òª¼ÓÃÜ£¿
¶þ¡¢¶¨ÖÆÀà×°ÈëÆ÷
Èý¡¢¼ÓÃÜ¡¢½âÃÜ
ËÄ¡¢Ó¦ÓÃʵÀý
Îå¡¢×¢ÒâÊÂÏî
²Î¿¼×ÊÔ´
Java³ÌÐòµÄÔ´´úÂëºÜÈÝÒ×±»±ðÈË
͵¿´¡£Ö»ÒªÓÐÒ»¸ö·´±àÒëÆ÷£¬ÈκÎÈ˶¼¿ÉÒÔ·ÖÎö±ðÈ˵ĴúÂë¡£±¾ÎÄÌÖÂÛÈçºÎÔÚ²»ÐÞ¸ÄÔÓгÌÐòµÄÇé¿öÏ£¬Í¨¹ý¼ÓÃܼ¼Êõ±£»¤Ô´´úÂë¡£
Ò»¡¢ÎªÊ²Ã´Òª¼ÓÃÜ£¿
¶ÔÓÚ´«Í³µÄC»òC++Ö®ÀàµÄÓïÑÔÀ´Ëµ£¬ÒªÔÚWebÉϱ£»¤Ô´´úÂëÊǺÜÈÝÒ׵ģ¬Ö»Òª²»·¢²¼Ëü¾Í¿ÉÒÔ¡£Òź¶µÄÊÇ£¬Java³ÌÐòµÄÔ´´úÂëºÜÈÝÒ×±»±ðÈË͵
¿´¡£Ö»ÒªÓÐÒ»¸ö·´±àÒëÆ÷£¬ÈκÎÈ˶¼¿ÉÒÔ·ÖÎö±ðÈ˵ĴúÂë¡£JavaµÄÁé»îÐÔʹµÃÔ´´úÂëºÜÈÝÒ×±»ÇÔÈ¡£¬µ«Óë´Ëͬʱ£¬ËüҲʹͨ¹ý¼ÓÃܱ£»¤´úÂë±äµÃÏà¶ÔÈÝÒ×£¬ÎÒÃÇ
ΨһÐèÒªÁ˽âµÄ¾ÍÊÇJavaµÄClassLoader¶ÔÏó¡£µ±È»£¬ÔÚ¼ÓÃܹý³ÌÖУ¬ÓйØJava Cryptography Extension£¨JCE£©
µÄ֪ʶҲÊDZز»¿ÉÉٵġ£
Óм¸ÖÖ¼¼Êõ¿ÉÒÔ“Ä£ºý”JavaÀàÎļþ£¬Ê¹µÃ·´±àÒëÆ÷´¦ÀíÀàÎļþµÄЧ¹û´ó´òÕÛ¿Û¡£È»¶ø£¬Ð޸ķ´±àÒëÆ÷ʹ֮Äܹ»´¦
ÀíÕâЩ¾¹ýÄ£ºý´¦ÀíµÄÀàÎļþ²¢²»ÊÇʲôÄÑÊ£¬ËùÒÔ²»Äܼòµ¥µØÒÀÀµÄ£ºý¼¼ÊõÀ´±£Ö ......
×òÌìÓиöÅóÓÑÎÊÎÒ£¬Ñ§µÃ»á²»,°³ËµÑ§µÄ»á£¡
ºóÀ´ËûÓÖÎÊÎÒ£¬ËûÈç¹ûѧµÄ»°£¬Ñ§µÄ»áѧ²»»á£¬°³ËµÖ»Òª²»±¿µ°£¬°ÑÐÄ˼·ÅÔÚjavaÉÏ£¬¾ÍÒ»¶¨Ñ§µÄ»á£¡
ʱ¼äÒ»Ö±¹ýµÄ¶¼ºÜ¿ì£¬Ã¿¸öÈËÄÜ°ÑÎÕµÄÒ²Ö»ÓнñÌ죬ËùÒÔ¼´Ê¹À§ÄÑÔٶֻ࣬ÓдËʱ´Ë¿Ì×Ô¼ºÔÚ²»Í£µÄŬÁ¦¡£
ÄÄÅÂÏñÎÏÅ£Ò»ÑùµÄÇ°½ø£¬Ò²Ò»¶¨Óгɹ¦µÄÒ»Ì죬¾ÍÅÂ×Ô¼º·ÅÆú£¬ÅÂ×Ô¼ºÃ»ÓÐÐÅÐÄ£¡£¡
Á¬½Ó³Ø£º
Á¬½Ó³ØÖÐÄÜ´æ·Å¶à¸öÁ¬½Ó
¿Í»§¶ËʹÓõÃʱºò£¬Ö±½Ó´ÓÁ¬½Ó³Ø»ñÈ¡Á¬½Ó
µ±¿Í»§¶ËʹÓÃÍêÁ¬½Óʱ£¬ÔÚ°ÑÁ¬½Ó·Å»Øµ½Á¬½Ó³ØÖÐ
ʹÓÃÁ¬½Ó³ØҪעÒâ
*ÒªÓÐÒ»¸ö³õʼ»¯Á¬½ÓÊý£¨Í¬Ê±ÔÚÏß5000ÈË,²»¿ÉÄÜÔÚ³ØÖдæ·Å5000¸öÁ¬½Ó£©
*×îС¿ÕÏÐÊý£¬±£´æÁ¬½Ó³ØÖУ¬´æÔÚ¿ÕÏÐÁ¬½Ó£¬·ÅÖúé·åµ½À´£¬ÒýÆðµÃÐÔÄÜ¿ªÏú£¨ÄÇôµ±³ØÖеÃÁ¬½ÓÓÃÍ꣬
ÓÐеÿͻ§¶ËÀ´·ÃÎÊ£»¾Í±ØÐë´´½¨ÐµÃÁ¬½Ó£¬ËùÒÔ¿ÉÒÔÔÚ³ØÖÐÉèÖÃ×îС¿ÕÏÐÊý£©
*×î´óÁ¬½ÓÊý£¨µ±Á¬½ÓÊý´ïµ½Êý¾Ý¿âµÃÉÏÏÞ£¬¾Í²»ÔÊÐí¼ÌÐø´´½¨ÐµÃÁ¬½Ó£©
*×î´óµÈ´ýʱ¼ä£¨Á¬½ÓÊý´ïµ½ÉÏÏÞ£¬Èç¹ûÓÐеÃÁ¬½Ó£¬Ôò±ØÐëµÈ´ýÆäËûÁ¬½ÓÊÍ·Å£¬Èô³¬¹ýµÈ´ýʱ¼ä£¬·þÎñÆ÷Å׳öÒì³££©
*×î´ó¿ÕÏÐÊý£¨µ±ºé·åÍËȥʱ£¬·ÀÖ¹Á¬½Ó³ØÖеÃÁ¬½ÓÊý¹ý¶à£©
javax.sql.DataSource ½Ó¿Ú ÓÉÇý¶¯³§É ......
Ò»¡¢ÔËËã·û
ËãÊõÔËËã·û£º+£¬-£¬*£¬/£¬%£¬++£¬--
¹ØϵÔËËã·û£º>£¬<£¬>=£¬<=£¬==£¬!=
²¼¶ûÂß¼ÔËËã·û£º!£¬&£¬^£¬|£¬&&£¬||
λÔËËã·û£º&£¬|£¬^£¬>>£¬<<£¬>>>
¸³ÖµÔËËã·û£º=
À©Õ¹¸³ÖµÔËËã·û£º+=£¬-=£¬*=£¬/=
×Ö·û´®Á´½ÓÔËËã·û£º+
Á½ÊýÏà³ý£¬ÄÇôÈç¹û½ÓÊÕµÄÖµÊÇÕûÐÍ£¬Ôò×Ô¶¯½«Ð¡ÊýµãÈ¥µô£¬0.5→0
%£ºÈ¡Ä££¬¼´ÓàÊý
++£º×ÔÔö
--£º×Ô¼õ
public class JavaDemo01
{
public static void main(String args[])
{
int i = 10 ;
int j = 20 ;
int k = i % j ;
System.out.println(k) ;
}
};
i++Óë++iµÄÇø±ð£º
public class JavaDemo03
{
public static void main(String args[])
{
int i = 10 ;
// i++ ;
// ÒÔÉÏ´úÂëÏ൱ÓÚÒÔϵijÌÐò¶Î£º
// i = i + 1 ;
// ++i£º±íʾÏÈÈÃÊý¾Ý×ÔÔö£¬Ö®ºóÔÙ½øÐвÙ×÷
// i++£º±íʾÏÈÈÃÊý¾Ý½øÐвÙ×÷£¬²Ù×÷Íê³ÉÖ®ºó½øÐÐ×ÔÔö
int k = 10+(++i) ;
System.out.println(k) ;
System.out.println(i) ;
}
};
Âß¼ÔËËã·û·µ»ØµÄ¶¼ÊDz¼¶ûÖµ
public class JavaDemo04
{
pub ......
×ܼǼÊý:6386; ×ÜÒ³Êý:1065; ÿҳ6 Ìõ;
Ê×Ò³ ÉÏÒ»Ò³ [4] [5] [6] [7] 8
[9] [10] [11] [12] [13] ÏÂÒ»Ò³ βҳ