https://code.sololearn.com/cPpWYgs5mgXM/?ref=app
8/10/2018 3:20:51 PM
Jinyoongisaranghe2 Answers
New Answerimport 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()); } }
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message