Questions about Java Interfaces
For practice I am trying to create an interface and learn how they work. I've named it Cost and included a test class called Car: public class Car implements Cost{ private String make; private int year; private String model; private double stickerPrice; public Car(){ make = ""; model = ""; year = 1950; stickerPrice = 0; } public String getMake(){ return make; } public String getModel(){ return model; } public int getYear(){ return year; } public void setCost(double c){ stickerPrice = c + SHIPPING_FEE; } public void setMake(String make){ this.make = make; } public void setModel(String model){ t
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.