Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Car {
- int modelYear;
- String modelName;
- double price;
- String type;
- public Car() {
- this(1969);
- }
- public Car(int modelYear) {
- this(modelYear, "Mustang");
- }
- public Car(int modelYear, String modelName) {
- this(modelYear, modelName, 120000);
- }
- public Car(int modelYear, String modelName, double price) {
- this(modelYear, modelName, 120000, "Ford");
- }
- public Car(int modelYear, String modelName, double price, String type) {
- this.modelYear = modelYear;
- this.modelName = modelName;
- this.price = price;
- this.type = type;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement