SHARE
TWEET

Untitled

advictoriam Mar 4th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class LabeledPoint
  2. {
  3.    private double x;
  4.    private double y;
  5.    private String label;
  6.  
  7.    /**
  8.       Constructs a labeled point with a given position and label.
  9.       @param anX the x-coordinate of the point
  10.       @param aY the y-coordinate of the point
  11.       @param aLabel the label of the point
  12.    */
  13.    public LabeledPoint(double anX, double aY, String aLabel)
  14.    {
  15.       x = anX;
  16.       y = aY;
  17.       label = aLabel;
  18.    }
  19.    
  20.    public String toString()
  21.    {
  22.       return String.format("LabeledPoint[x=%.1f,y=%.1f,label=%s]", x, y, label);
  23.    }
  24.  
  25.    public static String check(double x, double y, String s)
  26.    {
  27.       LabeledPoint lp = new LabeledPoint(x, y, s);
  28.       return lp.toString();
  29.    }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top