the fun of superclass like this:
fun onTrigger(params: P) {
if (!funA(params)) {
return
}
val request = funB(params)
}
funA and funB is abstract fun , implement in subclass like this(the generic P is Int):
fun funA(params:Int): Boolean {
if (params < 0) {
return false
}
}
fun funB(params:Int) {
val item = dataList[params]
}
accidental appearance crash:
java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
the params can be -1? why?