class Arithmetic { int x=10,y=20,z; void add() { z=x+y; System.out.println(z); } void sub() { z=x-y; System.out.println(z); } void mul() { z=x*y; System.out.println(z); } void div() { z=x/y; System.out.println(z); } } public class Main { public static void main(String[] args) { Arithmetic a=new Arithmetic(); a.add(); a.sub(); a.mul(); a.div(); } }
30
-10
200
0