Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApp1
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. var lista = new ArrayList();
  15. lista.Add(new Pracownik("Adam", "Zawada"));
  16. lista.Add(new Pracownik("Zbigniew", "Boniek"));
  17. lista.Add(new Pracownik("Adam", "Małysz"));
  18. lista.Add(new Pracownik("Roman", "Dmowski"));
  19. lista.Add(new Pracownik("Robert", "Kubica"));
  20. foreach (var element in lista)
  21. {
  22. Console.WriteLine(element.ToString());
  23. }
  24. //lista.Sort();
  25. foreach (var element in lista)
  26. {
  27. Console.WriteLine(element.ToString());
  28. }
  29. }
  30. }
  31.  
  32. interface IOsoba
  33. {
  34. void Opisz();
  35. }
  36.  
  37. public class Pracownik
  38. {
  39. private string imie;
  40. private string nazwisko;
  41.  
  42. public Pracownik(string imie, string nazwisko)
  43. {
  44. this.imie = imie;
  45. this.nazwisko = nazwisko;
  46. }
  47.  
  48. public override string ToString()
  49. {
  50. return imie + " " + nazwisko;
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement