返回列表 發帖

Java 基礎架構與輸出入

本帖最後由 b790113g 於 2011-12-10 11:31 編輯 ; I* O7 s. j/ N  y3 w% M
  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
! N: F/ K% f0 Y+ y' D7 z4 I( g! I0 d9 @
{
1 L: e( Q" ]+ }* [! `' z/ Z' _
+ c3 C3 W) H  B' h9 h& K  s9 e    public static void main(String[]arg)
' V) P7 S: h* x% n
( m4 k/ G  U6 B& p4 t        {) s: k: w: N! j

  T, q( f9 i! h                for(int i=0;i<arg.length;i++)7 Z' _+ _; i4 [; v7 C

7 s, z  u) M/ Z1 A                {
. g2 k) Y& K0 H" ~7 S# x& U2 i1 ]/ V
( Z# H. {9 _4 Q' G3 X                        System.out.println(arg[i]);# V( Y" ~, V3 x9 N7 B, y  g
) n$ I0 T: m2 f% {6 \3 n
                }6 ^. |7 j, R; ^7 p8 F4 O8 H; R+ Y0 k

  q/ v# `- K! Y   
3 E$ w! R+ A$ p$ N  G) @, L. S  J& U& X4 s: G( m2 m* n+ I3 G6 z
    }
! U  x, c4 f* O) B8 ~# e
1 Z. A; S( z5 O# v5 j# ^- j- `% l9 v

0 W5 A1 j) K, _: I+ l  i
, \; c% x+ E" T& j3 k4 |
5 r7 R% [  q0 `" N& t; Q}
人平

TOP

返回列表