Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- var lista = new ArrayList();
- lista.Add(new Pracownik("Adam", "Zawada"));
- lista.Add(new Pracownik("Zbigniew", "Boniek"));
- lista.Add(new Pracownik("Adam", "Małysz"));
- lista.Add(new Pracownik("Roman", "Dmowski"));
- lista.Add(new Pracownik("Robert", "Kubica"));
- foreach (var element in lista)
- {
- Console.WriteLine(element.ToString());
- }
- //lista.Sort();
- foreach (var element in lista)
- {
- Console.WriteLine(element.ToString());
- }
- }
- }
- interface IOsoba
- {
- void Opisz();
- }
- public class Pracownik
- {
- private string imie;
- private string nazwisko;
- public Pracownik(string imie, string nazwisko)
- {
- this.imie = imie;
- this.nazwisko = nazwisko;
- }
- public override string ToString()
- {
- return imie + " " + nazwisko;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement