Advertisement
Guest User

Untitled

a guest
May 25th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. public class Punkt3D extends Punkt {
  2.     int z;
  3.  
  4.     Punkt3D() {
  5.         this.z = 0;
  6.     }
  7.  
  8.     Punkt3D(int x, int y, int z) {
  9.         super(x, y);
  10.         this.z = z;
  11.     }
  12.  
  13.     Punkt3D(Punkt3D pkt) {
  14.         super(pkt);
  15.         this.z = pkt.z;
  16.     }
  17.  
  18.     public int getZ() {
  19.         return this.z;
  20.     }
  21.  
  22.     public void setZ(int z) {
  23.         this.z = z;
  24.     }
  25.  
  26.     void wyswietlPunkt3D() {
  27.         System.out.println("(" + this.x + ", " + this.y + ", " + this.z + ")");
  28.     }
  29.  
  30.     public String toString() {
  31.         return "(" + this.x + ", " + this.y + ", " + this.z + ")";
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement