有谁能帮我看看这个java程序错在哪了吗~

来源:百度知道 编辑:UC知道 时间:2024/05/03 11:51:55
interface automobile{
String automobile="automobile";
}
interface nonautomobile{
String n;
}
class vehicle implements automobile,nonautomobile{
static String name;
static int wheel;
public vehicle(){}
public vehicle(String a,int b){
name=a;
wheel=b;
}
void dowheel(){
if(name.equals(automobile))
{System.out.println("This is an automobile,which has "+wheel+" wheels"); }
else if(name.equals(nonautomobile))
{System.out.println("This is a nonautomobile,which has "+wheel+" wheels"); }
else {System.out.println("We can't find related model.");}
}
}

class bicycle extends vehicle{
void shuxing(){
vehicle abicycle=new vehicle();
abicycle.dowheel();
}

}
class bus extends vehicle{

interface AutoMobile{
String automobile="automobile";
}
-------------------------------
interface NonAutomobile{
String nonaoutomobile="Nonautomobile";
}
------------------------------
class Vehicle implements AutoMobile,NonAutomobile{
static String name;
static int wheel;
public Vehicle(){}
public Vehicle(String a,int b){
name=a;
wheel=b;
}
void doWheel(){
if(name.equals(automobile))
{System.out.println("This is an automobile,which has "+wheel+" wheels"); }
else if(name.equals(nonaoutomobile))
{System.out.println("This is a nonautomobile,which has "+wheel+" wheels"); }
else {System.out.println("We can't find related model.");}
}
}
---------------------------
class Bicycle extends Vehicle{
void shuXing(){
Vehicle abicycle=new Vehicle("Bicycle&quo