Advertisement
kadyr

Untitled

Oct 24th, 2022
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1.  
  2. public class Point2D<T>
  3. {
  4.     public T x { get; set; }
  5.  
  6.     public T y { get; set; }
  7.  
  8.     public Point2D(T x, T y)
  9.     {
  10.         this.x = x;
  11.         this.y = y;
  12.     }
  13. }
  14.  
  15. public class Z<T> : Point2D<T>
  16. {
  17.     public T z { get; set; }
  18.  
  19.     public Z(T x, T y, T z) : base(x, y)
  20.     {
  21.         this.z = z;
  22.     }
  23. }
  24.  
  25. public class Point3D<T>: Z<T>
  26. {
  27.     public Point3D(T x, T y, T z) : base(x, y, z)
  28.     {
  29.     }
  30.  
  31.     public string GetPoint()
  32.     {
  33.         return "x +" + x + " y +" + y + " z +" + z;
  34.     }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement