Opening Hours :7AM to 9PM
import Statements; .. .. class ClassName1 { .... .... } class ClassName2 { .... .... } class ClassName3 { .... .... } class ClassName4 { .... ... } ... ... class Main { public static void main(String args[]) { ClassName1 c1=new ClassName1(); .. .. .. c1.method() .. .. } }
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 oops2 { public static void main(String[] args) { Arithmetic a=new Arithmetic(); a.add(); a.sub(); a.mul(); a.div(); } }
class Addition { int x=10,y=20,z; void add() { z=x+y; System.out.println(z); } } class Substraction { int x=100,y=20,z; void sub() { z=x-y; System.out.println(z); } } class Multiplication { int x=10,y=20,z; void mul() { z=x*y; System.out.println(z); } } class Division { int x=10,y=20,z; void div() { z=x/y; System.out.println(z); } } public class oops1 { public static void main(String[] args) { Addition a=new Addition(); Substraction s=new Substraction(); Multiplication m=new Multiplication(); Division d=new Division(); a.add(); s.sub(); m.mul(); d.div(); } }