Guest User

Untitled

a guest
Jan 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. namespace classTutor
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. Osszeg x= new Osszeg();
  8. Osszeg g = new Osszeg(4, 5);
  9. int f = x.eredm(g);
  10. Console.WriteLine("{0}", f);
  11.  
  12. }
  13. }
  14. class Osszeg
  15. {
  16. public Osszeg()
  17. {
  18. this.x = 0;
  19. this.y = 0;
  20. }
  21. public Osszeg(int x, int y)
  22. {
  23. this.x = x;
  24. this.y = y;
  25. }
  26.  
  27. public static int eredm(Osszeg er)
  28. {
  29. return (er.x + er.y);
  30. }
  31.  
  32.  
  33. int x, y;
  34. }
  35. }
Add Comment
Please, Sign In to add comment