Posts

Showing posts with the label methods

Dynamic Parameter with “or”

Dynamic Parameter with “or” I'd like to know if it's possible to do something like this: public String gE(EditText text || TextInputEditText text || BootstrapEditText text){ return text.getText().toString(); } Perceive the use of "or", the parameters basically have the same attributes, but I would like a way that I can pass one or the other without having to create one for each element. Is it possible to do this in java? Pass a common superclass reference instead of the concrete implementations: public String gE(Text text) (assuming the existance of a common superclass Text ). – Turing85 Jun 30 at 17:14 public String gE(Text text) Text @Turing85 I did not quite understand how to do, can you show me an example? – Woton Sampaio Jun...