[JAVA] 建構子

class Car{
private int num;
private double gas;
public Car(){
this(1,2);
System.out.println("建構子1");
}
public Car(int a,int b){
System.out.println("建構子2");
}
}


class Sample3{
public static void main(String[] args){
Car car1=new Car();
}
}

沒有留言: