int a=2, b[]={1,2,3};
float c=3;
double d=3.14;
public static void show(int i)
public static void show(int arr[])
public static void show(float i)
public static void show(double i)
public static void show(int i)
public static void show(int arr[])
public class ch07_9 {
public static void main(String[] args) {
int a=2, b[]={1,2,3};
float c=3;
double d=3.14;
show(a);
show(b);
show(c);
show(d);
}
public static void show(int i){
System.out.println("值(a)="+i);
}
public static void show(int arr[]){
System.out.print("值(b)=");
for(int i=0;i<arr.length;i++)
System.out.print(arr[i]+" ");
}
public static void show(float i){
System.out.println("\n值(c)="+i);
}
public static void show(double i){
System.out.println("值(d)="+i);
}
}
show();
show(3);
show('A',5);
public static void show( ) //無引數
public static void show(int n) //一個引數
public static void show(char ch,int n) //兩個引數
public class ch07_9_2 {
public static void main(String[] args) {
show();
show(3);
show('A',5);
}
public static void show(){
System.out.println("no");
}
public static void show(int n){
for(int i=0;i<n;i++)
System.out.print("*");
System.out.println("");
}
public static void show(char ch,int n){
for(int i=0;i<n;i++)
System.out.print(ch);
}
}