Home > Back-end >  [discuss] for a need to input parameters but never directly invoke methods, what are the possible US
[discuss] for a need to input parameters but never directly invoke methods, what are the possible US

Time:04-16



As shown in figure, this is a hive ObjectStore class source (the scarlet letter, please ignore the class loading failure,), one of the two methods need to be a not use input parameters CTX



Obviously generally in all kinds of language is meaningless and is not standard, the author has no intention of writing the possibility is low, so the the input parameter may have what meaning?

I'm a little shallow guess: the original call is a generic, perhaps to a quick type judgment?

also not limited to Java, what are the cases useless input parameters can also play some magical function, under the share

CodePudding user response:

You need to see GetDbHelper class source code to know is what reason,
Here to write this useless because of some parameters to write class methods, must be consistent with the superclass method parameters,

CodePudding user response:

Methods it has override annotation, the inside of the parent class method is so defined, although subclasses in less than the parameters, but also should accept according to the order
  • Related