Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LabeledPoint
- {
- private double x;
- private double y;
- private String label;
- /**
- Constructs a labeled point with a given position and label.
- @param anX the x-coordinate of the point
- @param aY the y-coordinate of the point
- @param aLabel the label of the point
- */
- public LabeledPoint(double anX, double aY, String aLabel)
- {
- x = anX;
- y = aY;
- label = aLabel;
- }
- public String toString()
- {
- return String.format("LabeledPoint[x=%.1f,y=%.1f,label=%s]", x, y, label);
- }
- public static String check(double x, double y, String s)
- {
- LabeledPoint lp = new LabeledPoint(x, y, s);
- return lp.toString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement