1
參數我想延長在斯卡拉下面的Java類用「?」覆蓋方法在斯卡拉
到目前爲止,我已經寫的代碼是
package com.abhi
import org.apache.kafka.common.serialization.Serializer
import scala.runtime.ObjectRef
class PersonSerializer extends Serializer[Person] {
override def configure(configs: Map[String, ObjectRef], isKey: Boolean) : Unit = {
}
override def serialize(topic: String, p : Person) : Array[Byte] = {
Array[Byte]()
}
}
但是這給了我編譯時錯誤method configure overrides nothing
我試過搜索,但我無法弄清楚如何覆蓋配置方法,因爲「?」在java中定義