Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace classTutor
- {
- class Program
- {
- static void Main(string[] args)
- {
- Osszeg x= new Osszeg();
- Osszeg g = new Osszeg(4, 5);
- int f = x.eredm(g);
- Console.WriteLine("{0}", f);
- }
- }
- class Osszeg
- {
- public Osszeg()
- {
- this.x = 0;
- this.y = 0;
- }
- public Osszeg(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
- public static int eredm(Osszeg er)
- {
- return (er.x + er.y);
- }
- int x, y;
- }
- }
Add Comment
Please, Sign In to add comment