Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Point
- {
- private int x;
- private int y;
- public Point()
- {
- x = 0;
- y = 0;
- }
- public Point(int a, int b)
- {
- x = a;
- y = b;
- }
- // Other Methods not shown
- }
- public class NamedPoint extends point
- {
- private String name; // name of point
- // Constructors go here
- // Other methods not shown
- }
- I. public NamedPoint()
- {
- name = "";
- }
- II. public NamedPoint(int d1, int d2, String pointName)
- {
- x = d1;
- y = d2;
- name = pointName;
- }
- III. public NamedPoint(int d1, int d2, String pointName)
- {
- super(d1, d2);
- name = pointName;
- }
Advertisement
Add Comment
Please, Sign In to add comment