java - Unexpected error in Eclipse Juno main class -
this error getting in main class cartester @ line 21:
this class car:
package mohantyashutosh; public class car { private int mileage; private int gaspresent; private int price; public car(int mileage, int gaspresent, int price) { this.mileage = mileage; this.gaspresent = gaspresent; this.price = price; } public car() { // todo auto-generated constructor stub mileage = 20; gaspresent = 1 ; price = 500000; } public void drive(int distance) { } public void addgas(int quantity){ } }
i cannot understand why during object creation in main class, cannot take parameterized constructor.
Comments
Post a Comment