java ÖеÄÏÝÚå¡£
¿´ÁËÒ»¶Î±±·çÍøµÄÊÓƵ£¬×ܽἸ¸ö¾µäµÄjavaÏÝÚå¸ø´ó¼Ò¡£
´ð°¸ÔÚ²©¿ÍÖУºhttp://blog.csdn.net/ol_beta/archive/2010/05/17/5598867.aspx
»¶Ó´ó¼ÒÌÖÂÛ£¡
1¡¢ÕÒÆæÊý£º
Java code
public static boolean isOdd(int i){
return i % 2 == 0;
}
ÉÏÃæµÄ·½·¨ÕæµÄÄÜÕÒµ½ËùÓеÄÆæÊýô£¿
2¡¢¸¡µãÊýÏë¼õ
Java code
System.out.println(2.0-1.9);
System.out.println(2.0-1.9);
ÉÏÃæ»á´òÓ¡0.1ô£¿
3¡¢½»»»
Java code
int x = 2010;
int y = 2012;
x^=y^=x^=y;
System.out.println("x= " + x + "; y= " + y);
x¡¢yµÄÖµºô»½ÁËô£¿
4¡¢×Ö·ûºÍ×Ö·û´®
Java code
System.out.println("H" + "a");
System.out.println('H' + 'a');
ÉÏÃæÁ½¸öÓï¾äÊä³ö½á¹ûÏàͬô£¿
5¡¢ÎÞÏÞÑ»·
Java code
public static final int END = Integer.MAX_VALUE;
public static final int START = END - 100;
public static void main(String[] args) {
int count = 0;
for (int i = START; i <= END; i++)
count++;
System.out.println(count);
}
ÉÏÃæ³ÌÐòÔËÐеĽá¹ûÊÇʲô£¿
6¡¢¼ÆÊýÆ÷ÎÊÌâ
Java code
int minutes = 0;
for (int ms = 0; ms < 60*60*1000; ms++)
if (ms % 60*1000 == 0)
minutes++;
System.out.println(minutes);
½á¹û¸úÄãÏëµÄÒ»Ñùô£¿
7¡¢µ½µ×·µ»Øʲô£¿
Java code
public static boolean decision() {
try {
return true;
} finally {
return false;
}
}
true£¿false£¿
8¡¢´íÎóÀï¾Û¼¯±éÀú
Java code
public static void main(String[] args) {
Vector v = new Vector();
v.add("one");
v.add("two");
v.add("three");
v.add("four");
Enumeration enume = v.elements();
while (enume.hasMoreElements()){
String s = (String) enume.nextElement();
if (s.equals("two"))
v.remove("two");
else{
System.out.println(s);
}
}
System.out.println("What's really there...");
enume = v.elements();
while (enume.hasMoreElements()){
String s = (String)
Ïà¹ØÎĵµ£º
1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
1.³éÏó£º
³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º
¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£¬²¢ÇÒÔÊÐíºÍ¹ÄÀøÀàµÄÖØ ......
Throwable
Throwable ÀàÊÇ Java ÓïÑÔÖÐËùÓдíÎó»òÒì³£µÄ³¬Àà¡£Ö»Ó屶ÔÏóÊÇ´ËÀࣨ»òÆä×ÓÀàÖ®Ò»£©µÄʵÀýʱ£¬²ÅÄÜͨ¹ý Java ÐéÄâ»ú»òÕß Java throw Óï¾äÅ׳ö¡£ÀàËƵأ¬Ö»ÓдËÀà»òÆä×ÓÀàÖ®Ò»²Å¿ÉÒÔÊÇ catch ×Ó¾äÖеIJÎÊýÀàÐÍ¡£
Á½¸ö×ÓÀàµÄʵÀý£¬Error ºÍ Exception£¬Í¨³£ÓÃÓÚָʾ·¢ÉúÁËÒì³£Çé¿ö¡£Í¨³££¬ÕâЩʵÀýÊÇÔÚÒì³£Çé ......
1¡¢²âÊÔ·½·¨ÈçÏ£º
public static String toUtf8(String str) {
return new String(str.getBytes("UTF-8"),"UTF-8"):
&nb ......
¡¾Ò»¡¿»ùÓÚ×Ö½ÚµÄÊäÈëÁ÷
ÖµµÃ×¢ÒâµÄµØ·½ÓУº
¢ÙLevel 2µÄÊäÈëÁ÷£¬´ó¶àÊý¶¼»áÖ¸Ã÷Êý¾ÝÔ´µÄÐÎʽ£ºÀýÈçByteArray£¬File£¬Piped
¢ÚLevel 3µÄÊäÈëÁ÷£¬Ôò²»»á³öÏÖ¾ßÌåµÄÊý¾ÝÔ´Ãû×Ö£¬¶øÊÇÒÔ¹¦ÄÜÈ¡´ú£ºÀýÈçBuffered£¬LineNumber
ËùÒÔ˵Level 3µÄÊäÈëÁ÷ÊǶÔLevel 2ÊäÈëÁ÷µÄ“·â×°ºÍ¹ýÂË”¡£Êµ¼ÊÉÏLevel 2µÄÊäÈëÁ÷£¬¶¼¼ ......
1.Ê×ÏÈ¿´¶®¹Ù·½Îĵµ
2.icbc.jarÕâ¸öjar°üÒ»¶¨ÒªÒªµ½£¡ÕâÊǽøÐÐbase64¼ÓÃܽâÃÜ£¬ÒÔ¼°
ʹÓù¤ÐÐÖ¤ÊéÇ©ÃûµÄÖØÒª¹¤¾ßÀà¡£
3.²ÉÈ¡´¿Java±àÂ룬Ҫȷ±£ÓöÔÖ¤Ê飬·ÅÔÚDÅ̸ùĿ¼ÏÂ(ÆäËû·¾¶Òà¿É)¡£
4.±àдJSP½Ó¿ÚÒ³Ã棬×ֶαØÐëÓ빤ÐеÄÒ»Ò»¶ÔÓ¦¡£
¶øÇÒÈçtranDataµÈ×ֶνøÐÐbase64¼ÓÃܺó»òÕßÇ©Ãûºó ±ØÐëÒÔ"“Ë«ÒýºÅÀ©ÉϲŠ......