Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package puck;
- public class Weight extends Circle {
- private double weight;
- public Weight(double w){
- weight = w;
- }
- public void setWeight(double newWeight){
- weight = newWeight;
- }
- public double getWeight(){
- return(weight);
- }
- public String toString() {
- String weightString;
- weightString = "The weight is " + weight + ".";
- return(weightString);
- }
- }
Add Comment
Please, Sign In to add comment