Class is not Abstract and does not Override error in Java -
i getting compile time error java:
myclass not abstract , not override abstract method onclassiccontrollerremovedevent( wiiusej.wiiusejevents.wiiuseapievents.classiccontrollerremovedevent) in wiiusejevents.utils.wiimotelistener)
here class:
import wiiusej.wiiuseapimanager; import wiiusej.wiimote; import wiiusej.wiiusejevents.physicalevents.expansionevent; import wiiusej.wiiusejevents.physicalevents.irevent; import wiiusej.wiiusejevents.physicalevents.motionsensingevent; import wiiusej.wiiusejevents.physicalevents.wiimotebuttonsevent; import wiiusej.wiiusejevents.utils.wiimotelistener; import wiiusej.wiiusejevents.wiiuseapievents.disconnectionevent; import wiiusej.wiiusejevents.wiiuseapievents.nunchukinsertedevent; import wiiusej.wiiusejevents.wiiuseapievents.nunchukremovedevent; import wiiusej.wiiusejevents.wiiuseapievents.statusevent; public class myclass implements wiimotelistener{ public void onbuttonsevent(wiimotebuttonsevent arg0) { system.out.println(arg0); if (arg0.isbuttonapressed()){ wiiuseapimanager.shutdown(); } } public void onirevent(irevent arg0) { system.out.println(arg0); } public void onmotionsensingevent(motionsensingevent arg0) { system.out.println(arg0); } public void onexpansionevent(expansionevent arg0) { system.out.println(arg0); } public void onstatusevent(statusevent arg0) { system.out.println(arg0); } public void ondisconnectionevent(disconnectionevent arg0) { system.out.println(arg0); } public void onnunchukinsertedevent(nunchukinsertedevent arg0) { system.out.println(arg0); } public void onnunchukremovedevent(nunchukremovedevent arg0) { system.out.println(arg0); } public static void main(string[] args) { wiimote[] wiimotes = wiiuseapimanager.getwiimotes(1, true); wiimote wiimote = wiimotes[0]; wiimote.activateirtracking(); wiimote.activatemotionsensing(); wiimote.addwiimoteeventlisteners(new myclass()); } }
can better explanation of error means?
your class implements interface wiimotelistener
, has method onclassiccontrollerremovedevent
. however, methods in interfaces abstract
, means contracts no implementations. need 1 of things here:
- implement method , other methods interface declares, make class concrete, or
- declare class abstract, cannot used instantiate instances, used superclass.
Comments
Post a Comment