返回列表 發帖

Java 基礎架構與輸出入

本帖最後由 b790113g 於 2011-12-10 11:31 編輯 ( W  z  {) _9 |6 g0 G
  1. public class d1210 {

  2.         public static void main(String[] arg){
  3.        
  4.                 for(int i=0;i<arg.length;i++){
  5.                
  6.                         System.out.println(arg[i]);
  7.                        
  8.                 }
  9.                
  10.         }

  11. }
複製代碼
  1. public class d1210 {

  2.         public static void main(String[] arg){
  3.        
  4.                 try{
  5.                         System.out.println(arg[0]);
  6.                 }catch(Exception e){}
  7.                
  8.                 try{
  9.                         System.out.println(arg[1]);
  10.                 }catch(Exception e){}
  11.                
  12.         }

  13. }
複製代碼
d1210 處一定要跟檔名相同

public class tom1210
1 b& m, v( Q1 v9 T2 Y
: R+ B9 y/ L) k1 i$ w- q' Y{
) J0 D& C9 d7 v( X7 j5 K' E- t6 Q. U) Z2 u8 \" i$ H
    public static void main(String[]arg)* x3 K' C- E0 I8 i2 K% |6 b

0 e' ~' ~' h+ d8 C& ~; r. }        {/ W0 m8 Z6 S+ ]' v9 W

" n: G' o9 }) f9 [- e- F                for(int i=0;i<arg.length;i++)" b) L! T" c  R$ ]6 ~
+ w2 h) C6 `, f2 D5 [# j, p
                {
" w2 z& Y+ R/ P# h! Y6 S- ]% C
0 l$ R3 Q9 ?0 S% {) z8 g9 a                        System.out.println(arg[i]);
4 m  q8 Q) O9 Z
# ^7 \9 v9 r' x7 ]                }: Z4 L( P# S, {2 u% |
3 ]: a4 [: V  C8 V4 I1 p
   
& Q3 o- R" I% j5 p
8 G- O! k0 l) O9 H0 r, ~% k% x    }3 d8 [6 d* f& M$ K1 e

  v. l, c3 R: E. U  b
2 X8 @$ i) ^6 K& s( Y  V( Q& r2 ]1 H; a% a% l* r, e
  C" r, m5 z" [7 n: O' Z

9 Z1 s6 N- n2 G1 ~}
人平

TOP

  1. public class j1 {
  2. public static void main(String[] args){
  3.         for(int i=0;i<args.length;i++){
  4.                 System.out.print("你好!");
  5.                 System.out.println(args[i]+",");
  6.                 System.out.println("我叫陳彥綸!");
  7.                 System.out.println("粉高興認識你!");
  8.                 System.out.println("bye-bye!");
  9.         }
  10. }
  11. }
複製代碼
陳彥綸

TOP

  1. public class j1210{
  2.     public static void main(String[]arg){
  3.        
  4.         for(int i=0;i<arg.length;i++)
  5.         {
  6.        
  7.         System.out.println(arg[i]);
  8.        
  9.         }
  10.        
  11.        
  12.     }
  13. }
複製代碼
小雲雀

TOP

  1. public class tom1210
  2. {
  3.     public static void main(String[]arg)
  4.         {
  5.                 for(int i=0;i<arg.length;i++)
  6.                 {
  7.                         System.out.println(arg[i]);
  8.                 }
  9.    
  10.     }


  11. }
複製代碼
水桶小鄭,鯰魚

TOP

返回列表