返回列表 發帖

Java 基礎架構與輸出入

本帖最後由 b790113g 於 2011-12-10 11:31 編輯 ; }, g9 u! P& [  L& H
  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 處一定要跟檔名相同

  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

  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 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

public class tom1210
7 y' k/ D" M" I& V7 x9 c
: p: R! O: P. V& u' F{1 n' X" a6 }8 H9 S3 ?- Y; d% S

" I$ p4 K8 g# a" v9 |5 c8 j9 y3 @    public static void main(String[]arg)! x3 K7 ~& }8 s

, s1 T, M' }4 }' `% n+ j        {8 `, @- s& ?; x2 U, X7 |5 P+ v* k

, n: L. G, U) ]* \. J# V% h                for(int i=0;i<arg.length;i++)5 s# V+ C4 i% I' d" X% X: a5 r

; t0 ^( g5 G4 P* R% `* O- b                {
+ ^! H* {& L" `& m5 G$ w3 X0 o1 a+ S' e9 w
                        System.out.println(arg[i]);
( r$ T) a! S; h  I: z- C, d& u) K: C; ^- C, s
                }
' E: a8 a6 A( [5 s* C2 r6 m# V# \; ^  ^, Z' [7 y3 C7 I7 H
   
9 ^7 c$ s8 [6 R2 e: W- \
! H6 ~2 d  \. I# Y2 F: e    }6 v& ]( o6 h& P' u+ L/ K
0 @2 C4 k6 V/ M- f, K/ o
1 p! t( N, s8 H+ C6 J( }( A- ~) A* `
+ D( w+ W, l9 _4 u9 O8 O
5 f" [# v/ V5 i7 o( E
/ X6 X6 j" E0 `6 m9 i% ]
}
人平

TOP

返回列表