using System;
class Int {
private int num;
public Int(int val = 0) {
num = val;
}
public void display() {
Console.WriteLine(num);
}
public void add(Int val1, Int val2) {
num = val1.num + val2.num;
}
}
class MainClass {
public static void Main (string[] args) {
Int a = new Int();
Int b = new Int(2);
Int c = new Int(4);
a.add(b, c);
a.display();
}
}
Comments
Leave a comment