+ 7
method to receive double and boolean
can a method receive both a double and a boolean? How to write it? I understand that public static void Name(double n) // to receive double but what if the method needs to receive a boolean too?
3 Answers
+ 11
Just define a function with multiple parameters! :>
public static void Name(double n, boolean b) {
...
}
+ 3
Use casting method
+ 2
You can of course have multiple parameters each of different kind
Like.
void function_name(boolean parm1, double parm2){
// your code
}