0
Can someone help me with this? Im new to coding..
2 Answers
+ 11
import java.util.Scanner;
public class Vehicle {
int fuel;
String colour;
String brand;
int getFuel() {
return fuel;
}
void setFuel(int f) {
fuel = f;
}
}
public class tryhard {
public static void main(String[] args) {
Vehicle obj=new Vehicle();
Scanner wc = new Scanner(System.in);
System.out.println("Enter price number of your fuel");
obj.setFuel(wc.nextInt());
System .out.println(obj.getFuel());
}
}
0
thanks a lotđ€