class Greatest
{
int a,b,c;
Greatest(int aa,int bb,int cc)
{
a=aa;
b=bb;
c=cc;
}
void calc()
{
if(a>=b && a>=c)
{
System.out.println(a+" is Greater.");
}
else if(b>a && b>=c)
{
System.out.println(b+" is Greater.");
}
else
{
System.out.println(c+" is Greater.");
}
}
};
class Exp2_1
{
public static void main(String[] args)
{
Greatest g = new Greatest(40,30,40);
g.calc();
}
}
No comments:
Post a Comment