Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import java.awt.*;
  2. import java.util.Date;
  3.  
  4. public class ChristmasTree extends Tree {
  5. protected int height;
  6. protected int starheight;
  7.  
  8. public ChristmasTree(int height,int starheight) {
  9. super.height = height;
  10. this.starheight = starheight;
  11. }
  12.  
  13. public Color getExpectedColor(Date date) {
  14. return Color.GREEN;
  15. }
  16.  
  17. @Override
  18. public String toString() {
  19. return super.toString() + height + starheight + "meters high";
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement