SHARE
TWEET

Untitled

a guest Jun 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.* ;
  2. import java.awt.* ;
  3.  
  4. public class Chap27Ex1
  5. {
  6.   public static void main ( String[] args ) throws IOException
  7.   {
  8.     int x1, x2, y1, y2;
  9.     String charData ;
  10.     BufferedReader stdin =
  11.       new BufferedReader(new InputStreamReader(System.in));
  12.  
  13.     // 1. Point-Objekt x- und y-Werte vom Anwender holen
  14.     System.out.println("1. Point-Objekt x-Wert eingeben");
  15.     charData = stdin.readLine();
  16.     x1 = Integer.parseInt(charData);
  17.     System.out.println("1. Point-Objekt y-Wert eingeben");
  18.     charData = stdin.readLine();
  19.     y1 = Integer.parseInt(charData);
  20.  
  21.     // 2. Point-Objekt x- und y-Werte vom Anwender holen
  22.     System.out.println("2. Point-Objekt x-Wert eingeben");
  23.     charData = stdin.readLine();
  24.     x2 = Integer.parseInt(charData);
  25.     System.out.println("2. Point-Objekt y-Wert eingeben");
  26.     charData = stdin.readLine();
  27.     y2 = Integer.parseInt(charData);
  28.  
  29.     // Point-Objekte erzeugen und ausgeben
  30.     Point pt1 = new Point(x1, y1);
  31.     Point pt2 = new Point(x2, y2);
  32.     System.out.println(pt1);
  33.     System.out.println(pt2);
  34.   }
  35. }
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top