+ 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 Answers
+ 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