Develop a C++ program having a class called mathematics used to calculate sum for two integer values. The program should create an object of the class in main( ) program.
class Math<T> {
static T sum(T a, T b) { return a + b; }
public static void main(String[] args) {
System.out.println(Math<int>.sum(4, 6));
}
}
Comments
Leave a comment