返回列表 發帖

Java 基礎架構與輸出入

本帖最後由 b790113g 於 2011-12-10 11:31 編輯 , Q* P& m6 b6 f* ?
  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) I6 S+ a2 H3 }) D. b
& U% ~$ k2 l5 a{
4 O- ]1 s9 Y0 m
, u2 ]- c0 d) U9 r    public static void main(String[]arg)2 t  I0 \' z- F7 b" g) u$ N
1 E* t9 I( I2 N; S/ ~$ @( U
        {
! ?$ T* t$ J8 Y
' h  {! u. k) a1 S/ X; x                for(int i=0;i<arg.length;i++)
& B7 D$ [$ s8 t5 r, t, Y+ W: {& {6 M7 A; E9 Q
                {$ n6 i7 ]6 E' v) P% [/ f  {9 o
5 i6 H$ s! k5 G7 e: P
                        System.out.println(arg[i]);! l# O7 q5 Y9 D: B& H. {
4 g) h3 l. Y% V5 c6 j. c% w( W
                }
* J6 R6 F* T" Q" {# G+ x0 I! P: N) i, l0 Q" Q4 g' v9 u: a  y
    ! G9 q9 ?( Q( Z- U2 }

$ ?0 w: i' g0 j' l    }2 p- _6 G2 M: H! D: u7 ]# b( f

/ ~) N4 I5 ]1 ]
2 h# ]3 ]- p# |% e- B& n7 L
$ D0 [6 W1 t* y1 M) V4 v% }4 P5 o/ \0 k8 Z6 q8 |( [. k+ l' H- }

' P$ `4 D# |/ q! b5 J9 H# v}
人平

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

返回列表