java ʵÏÖÖÐÓ¢ÎÄ»ìʱµÃµ½³¤¶È ¹ý³¤×Ö·ûÌæ»»
java ´úÂëʵÏÖ
public static boolean isLetter(char c) {
int k = 0x80;
return c / k == 0 ? true : false;
}
/**
* µÃµ½Ò»¸ö×Ö·û´®µÄ³¤¶È,ÏÔʾµÄ³¤¶È,Ò»¸öºº×Ö»òÈÕº«Îij¤¶ÈΪ2,Ó¢ÎÄ×Ö·û³¤¶ÈΪ1
*
* @param s ÐèÒªµÃµ½³¤¶ÈµÄ×Ö·û´®
* @return iµÃµ½µÄ×Ö·û´®³¤¶È
*/
public static int strlength(String s) {
if (s == null)
return 0;
char[] c = s.toCharArray();
int len = 0;
for (int i = 0; i < c.length; i++) {
len++;
if (!isLetter(c[i])) {
&
Ïà¹ØÎĵµ£º
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 ......
public class P {
public static void main(String[] args){
String pattern="000";
java.text.DecimalFormat df = new java.text.DecimalFormat(pattern);
int i = 10,j=6;
System.out.println("i="+df.format(i)+"\nj="+df.format(j));
}
}
---------------------Êä³ö-----------------------
i=010 ......
¡¡×î½ü²Å¿ªÊ¼Ñ§Ï°java,¸Ð¾õ»¹¿ÉÒÔ°É£¬Ã»ÓÐÏëÏóÖеÄÄÇôÄÑѧ£¬Ò²ÐíÊÇÓÐÒ»¶¨µÄÓïÑÔ»ù´¡°É£¡¿ÉÄÜÓÐʱÓöµ½Ê²Ã´ÎÊÌâ½â¾ö²»ÁË»áÓеãСÓôÃÆ°É£¬µ«ÊÇÒ»µ«ÅªÃ÷°×ÁË»¹ÊǾõµÃÌì¿ÕÂùÇçÀʵģ¬ºÇºÇ£¬ºÃÏë×Ô¼ºÄܹ»Å¬Á¦½«ËüѧºÃ£¬ÕâÑù²Å»áÓÐÒ»µãµãµÄ³É¾Í¸Ð°¡£¡Ï£ÍûÒÔºóÄܼÓÇ¿Á·Ï°£¬Ìá¸ß×Ô¼ºµÄ±à³ÌÄÜÁ¦£¡Ð¡²ËÄñÒ»¸ö£¡¹þ¹þ£¡£¡ ......
javaÖÐÒì³£µÄÁ½ÖÖ´¦Àí£º
1.try...catch....finally ´æÔÚÓ뵱ǰµÄÒì³£´¦ÀíÀ࣬±íʾµ±Ç°ÓÉ×Ô¼ºµÄ·½·¨À´´¦Àí
2.Throw ½«µ±Ç°Òì³£Å׳ö £¬½»ÓÉÉϼ¶À´´¦Àí¡£
try...catch....finallyµÄ´¦ÀíÁ÷³Ì£º
½«³öÏÖÒì³£µÄÓï¾ä·ÅÔÚtryÖУ¬Ò»¶Î´ËÓï¾ä³ö´í£¬³ÌÐò»áÔÝÍ£Ö´ÐУ¬Òì³£´¦Àí»úÖÆ¾ÍÈ¥½Ó¹Ü³ÌÐò£¬
½ ......