返回列表 發帖
  1. package 自訂函式;

  2. public class ch01 {

  3.         static void hello(int n)
  4.     {
  5.             for(int i=0; i<n; i++)
  6.                 System.out.println("Hello!!!");
  7.     }
  8.    
  9.     static int myPlus(int a, int b, int c)
  10.     {
  11.             return a+b+c;
  12.     }
  13.    
  14.     public static void main(String[] args)
  15.     {
  16.             hello(5);
  17.             System.out.println(myPlus(1,2,3));
  18.     }
  19. }
複製代碼

TOP

返回列表