Question #268856

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.


Expert's answer

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));
   }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS