+ 1
In this java code showing 1 error what is that can u help me.
class Vechile{ int passengers; int fuelcap; int mpg; } class VechileDemo{ public static void main(string args[]){ Vechile minivan = new Vechile(); int range; minivan.passengers=7: minivan.fuelcap =16; minivan.mpg=21; range = minivan.fuelcap * minivan.mpg; System.out.println("minivan carry " + minivan.passengers +"with a range of " + range ); } }
2 Réponses
+ 14
class Vechile{
int passengers;
int fuelcap;
int mpg;
}
class VechileDemo{
public static void main(String args[]){ //here was also 1 error 👈
Vechile minivan = new Vechile();
int range;
minivan.passengers=7; // here was the another error👈
minivan.fuelcap =16;
minivan.mpg=21;
range = minivan.fuelcap * minivan.mpg;
System.out.println("minivan carry " + minivan.passengers +"with a range of " + range );
}
}
//this will work buddy & the errors u made were just typing error ☺
//hope it helps ☺
+ 1
thanks for your help guys