Advertisement
kk258966

4/8 物件導向程式設計 練習二

Apr 8th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. public class B10207081_1{
  2.    public static void main(String args[]){
  3.    
  4.        
  5.     show();
  6.     show(8,2);
  7.     show(3,5,9);
  8.    
  9.     System.out.println("B10207081");
  10.     System.out.println("==============================");
  11.    }
  12.    
  13.    public static void show(){
  14.    
  15.     System.out.print("show()=");
  16.     for(int i=0;i<9;i++){
  17.         System.out.print("*");
  18.         }
  19.     System.out.print("\n=========================\n"); 
  20.    }
  21.    
  22.    
  23.    public static void show(int m, int n){
  24.      System.out.println("m="+m+"  n="+n);  
  25.      if(m>n)
  26.        System.out.println("最大值:"+m);
  27.      else
  28.        System.out.println("最大值:"+n);  
  29.      
  30.      System.out.println("==============================");      
  31.    }
  32.              
  33.    
  34.    
  35.    public static void show(int a1, int a2, int a3){
  36.    
  37.      System.out.println("a1="+a1+"  a2="+a2+"  a3="+a3);
  38.      System.out.println("a1+a2+a3="+(a1+a2+a3));
  39.      System.out.println("==============================");          
  40.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement