using System;
public class Punkt
{
private int x;
private int y;
// Konstruktor domyślny
public Punkt()
{
x = 0;
y = 0;
}
// Konstruktor jednoparametrowy
public Punkt(int xy)
{
x = xy;
y = xy;
}
// Konstruktor dwuparametrowy
public Punkt(int x, int y)
{
this.x = x;
this.y = y;
}
// Destruktor
~Punkt()
{
Console.WriteLine($"Usuwanie punktu o współrzędnych ({x}, {y})");
}
// Metoda do wyświetlania współrzędnych punktu
public void WyswietlWspolrzedne()
{
Console.WriteLine($"Współrzędne punktu: ({x}, {y})");
}
}
Paste Hosted With By Wklejamy.pl