+5

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?

12/6/2018 12:01:11 PM

Poo

3 Answers

New Answer

+11

Just define a function with multiple parameters! :> public static void Name(double n, boolean b) { ... }

+1

You can of course have multiple parameters each of different kind Like. void function_name(boolean parm1, double parm2){ // your code }

0

Use casting method