返回列表 發帖

Java 基礎架構與輸出入

本帖最後由 b790113g 於 2011-12-10 11:31 編輯
4 P! b, t, p& m4 V
  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' x/ E9 S. X% l3 f
7 R* C- ?! _9 g7 Q4 H, B% u! J
{: S* V3 J* v1 L$ q5 D4 |3 U
' A6 z+ Z1 ~8 c4 @# j
    public static void main(String[]arg)
8 t. x7 v% j5 n& ^# i+ s. `/ E4 Y6 C) g
        {0 v1 e8 t, w8 P/ E; w! }2 F
3 X' k! m. l* z2 V
                for(int i=0;i<arg.length;i++)- m9 g( j, _; g5 R$ o3 f5 }
% F/ v7 w8 T1 D
                {
1 e% J& o3 r6 v+ M. `3 i$ t
, A, A5 X% W) `% ^3 Q. d6 ^4 h! L                        System.out.println(arg[i]);7 a. j* Q: t1 H/ _: r2 |' g
0 r: s& B2 Z( L' r8 a2 C# |. Q
                }7 q3 v: t/ }8 i/ p' o
, L( o  H/ S/ `6 [
    * c0 |, L/ T( W

# Q$ r) [2 \  m& k' p    }. ?- V! S  y/ A/ ^, `) q
( l# K' X4 v8 A
9 P0 ]- |, ~9 d0 p4 A. `# H  B
7 p4 }* ~1 i/ j& a: K$ t7 Q6 z
% t0 t: G7 m) a9 e
1 U& O: @" L/ r
}
人平

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

返回列表