joyalshark joyalshark - 8 months ago 36
Java Question

How to divide and implement two seprate classes using if statement

I was wondering is there any way we can implement two classes like below.

do everything(methods and all)in Class1
do everything(methods and all) in class2

I know how to do using each method using Class object. There will be something make easy to do things.


Your best bet would be to define an interface, with a method void doEverything().

This would then be implemented by Class1 and Class2.