import java .util.*;
import java.io.*;
class MaxIt<T extends Number >
{
T x;
public T maxi(T a,T b)
{
if(a>b)
return a;
else
return b;
}
}
public class MaxGen{
public static void main(String[] args)
{
MaxIt<Integer> i=new MaxIt<Integer>();
System.out.println("enter two integer ");
int a,b;
Scanner sc=new Scanner(System.in);
a=sc.nextInt();
b=sc.nextInt();
System.out.println(a,b);
} }
I was reading about generic, so i have tried to make a generic program for finding maximum of two numbers but when i am compiling this it is giving me an error saying that - bad operand type for binary operator '>'. can u tell me what is wrong in this code?