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