JAVAÅжÏ×Ö·û´®ÊÇ·ñΪÊý×Ö
StringתCharacterÊý×飬ÓÃCharacterµÄisDigitºÍisLetterº¯ÊýÈ¥Åжϡ£
public static boolean isNumeric(String str) {
for (int i = str.length(); i = 0;) {
if (!Character.isDigit(str.charAt(i))) {
return false;
}
}
return true;
}
public static boolean isNumeric(String str) {
Pattern pattern = Pattern.compile("[0-9]*");
return pattern.matcher(str).matches();
}
public static boolean isNumeric(String str) {
if (str.matches("““d*")) {
return true;
}
return false;
}
public static boolean isNumeric(String str) {
for (int i = str.length(); i = 0;) {
int chr = str.charAt(i);
if (chr 48chr 57)
return false;
}
return true;
}
Ïà¹ØÎĵµ£º
½ñÌìÓöµ½Ò»¸öÒªÉú³ÉÒ»¸öÏÂÀÁбí¿òµÄÎÊÌ⣬ÎÒµÄÏë·¨ÊÇ£º½«Êý¾Ý¿âÄÚµÄËùÓÐÊý¾Ý¶¼´æ´¢µ½Ò»¸öListÀïÃ棬ÔÙÔÚǰ̨±éÀúÕû¸ölist¡£
Ö´ÐÐЧ¹ûͼ£º
Ë®¹û
→Æ»¹û
→→Æ»¹ûϵÁÐ1
→→Æ»¹ûϵÁÐ2
→→Æ»¹ûϵÁÐ3
→→Æ»¹ûϵÁÐ4
→Àæ
→ÌÒ×Ó
ѧϰÓÃÆ·
→±Ê
→→Ǧ±Ê ......
1, ±£Ö¤Ḭ̈߳²È«µÄÈýÖÖ·½·¨ :
a, ²»Òª¿çÏ̷߳ÃÎʹ²Ïí±äÁ¿
b, ʹ¹²Ïí±äÁ¿ÊÇ finalÀàÐ͵Ä
c, ½«¹²Ïí±äÁ¿µÄ²Ù×÷¼ÓÉÏͬ²½
2, Ò»¿ªÊ¼¾Í½«ÀàÉè¼Æ³ÉḬ̈߳²È«µÄ , ±ÈÔÚºóÆÚÖØÐÂÐÞ¸´Ëü ,¸üÈÝÒ× .
3, ±àд¶àÏ̳߳ÌÐò , Ê×Ïȱ£Ö¤ËüÊÇÕýÈ·µÄ , Æä´ÎÔÙ¿¼ÂÇÐÔÄÜ .
4, ÎÞ״̬»òÖ»¶Á¶ÔÏóÓÀÔ¶ÊÇḬ̈߳²È«µÄ .
5, ²»Òª½«Ò»¸ö¹²Ïí±äÁ¿Âã ......
1.°Ë½øÖÆתÒåÐòÁУº\ + 1µ½3λ5Êý×Ö£»·¶Î§'\000'~'\377'
\0£º¿Õ×Ö·û
2.UnicodeתÒå×Ö·û£º\u + ËĸöÊ®Áù½øÖÆÊý×Ö£»0~65535
\u0000£º¿Õ×Ö·û
3.ÌØÊâ×Ö·û£º¾Í3¸ö
\"£ºË«ÒýºÅ
\'£ºµ¥ÒýºÅ
&nbs ......
Apache MINA (mina-2.0.0-M6Ô´ÂëΪÀý):
ÎÒÃÇʹÓÃmina nio tcp×î³£ÓõÄÑùÀýÈçÏÂ:
NioSocketAcceptor acceptor = new NioSocketAcceptor(/*NioProcessorPool's size*/);
DefaultIoFilterChainBuilder cha ......