class MaxNumber { int x,y; MaxNumber() { x=10; y=20; } String max() { if(x>y) { return("x is Max Number"); } else { return("y is Max Number"); } } } public class Main { public static void main(String args[]) { MaxNumber m=new MaxNumber(); String s=m.max(); System.out.println(s); } }
y is Max Number