How to Override A Method in Java -
i play robocode (it java programming game). want change method public void onscannedrobot (scannedrobotevent e) { } to public int onscannedrobot(scannedrobotevent e){ } so can adapt robot more if scanned true or false. i heard possible overriding method. tryed it: i wrote: public void onscannedrobot(scannedrobotevent e) { public int onscannedrobot(scannedrobotevent e) { return 1; } } but won't work this won't work because return type of overriden method should same or subtype of return type declared in original method. @ link overriding , overloading