java求助在Car car1=new Car(20,"北京现代");错误提醒我The constructor Car(int, String) is undefined 5
packageGaoBL;importjava.util.HashSet;publicclassHashSet1{publicstaticvoidmain(Stringa...
package GaoBL;
import java.util.HashSet;
public class HashSet1 {
public static void main (String args[]){
HashSet hs=new HashSet();
Car car1=new Car(20,"北京现代");
Car car2=new Car(21,"北京现代");
Car car3=new Car(22,"北京现代");
Car car4=new Car(23,"北京现代");
Car car5=new Car(24,"北京现代");
hs.add(car1);
hs.add(car2);
hs.add(car3);
hs.add(car4);
hs.add(car5);
}
/**********************************************************************/
package GaoBL;
public class Car {
String pinPai;
long chuChangRiQi;
public Car(int newchuChangRiQi,String newpinPai ){
this.chuChangRiQi=newchuChangRiQi;
this.pinPai=newpinPai;
}
这个怎么解决啊 。。。。。。。 展开
import java.util.HashSet;
public class HashSet1 {
public static void main (String args[]){
HashSet hs=new HashSet();
Car car1=new Car(20,"北京现代");
Car car2=new Car(21,"北京现代");
Car car3=new Car(22,"北京现代");
Car car4=new Car(23,"北京现代");
Car car5=new Car(24,"北京现代");
hs.add(car1);
hs.add(car2);
hs.add(car3);
hs.add(car4);
hs.add(car5);
}
/**********************************************************************/
package GaoBL;
public class Car {
String pinPai;
long chuChangRiQi;
public Car(int newchuChangRiQi,String newpinPai ){
this.chuChangRiQi=newchuChangRiQi;
this.pinPai=newpinPai;
}
这个怎么解决啊 。。。。。。。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询