Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Osoby
- {
- public class Osoba
- {
- private string nazwisko;
- private int rok;//rok urodzenia
- public void SetName(string tmpnazwisko)//ustawia nazwisko
- {
- this.nazwisko = tmpnazwisko;
- }
- public string GetName()//zwraca nazwisko
- {
- return this.nazwisko;
- }
- public void SetDate(int tmprok)//ustawia rok urodzenia
- {
- this.rok = tmprok;
- }
- public int GetDate()//zwraca rok urodzenia
- {
- return this.rok;
- }
- public override Boolean operator <(Osoba a, Osoba b)//a<b return true,a>=b return false
- {
- Boolean tmp;
- if(string.Compare(a.nazwisko, b.nazwisko,true)<0)
- tmp=true;
- else
- tmp=false;
- return tmp;
- }
- }
- }
Add Comment
Please, Sign In to add comment