Untitled
Guest 74 16th Apr, 2024
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})");
}
}
To share this paste please copy this url and send to your friends
RAW Paste Data