我想增加一個額外的參數發送()在功能覆蓋抽象
在DumpSequence.java:
private static Receiver sm_receiver = new DumpReceiver(System.out, true);
sm_receiver.send(message, lTicks); (Work)
sm_receiver.send(message, lTicks, addParam1); (Won't work)
DumnpReceiver.java我試圖增加額外的PARAM這是lTimeStamp2:
public void send(MidiMessage message, long lTimeStamp, long lTimeStamp2) {...}
錯誤:
DumpSequence.java:136: send(javax.sound.midi.MidiMessage,long) in javax.sound.mi
di.Receiver cannot be applied to (javax.sound.midi.MidiMessage,long,long)
sm_receiver.send(message, lTicks, lTicks);
^
.\DumpReceiver.java:21: DumpReceiver is not abstract and does not override abstr
act method send(javax.sound.midi.MidiMessage,long) in javax.sound.midi.Receiver
public class DumpReceiver
^
2 errors
AFAIK接口,他沒有問這個。他想給'send'方法添加一個參數,並從'sm_receiver'中調用它,一個'Receiver'變量 – Serabe
@Serabe我遲到了..已經將它包含在答案中 –
噢,我沒有使用任何@Override註釋。 – thunder31