method to receive double and boolean | Sololearn: Learn to code for FREE!


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


3 Answers

New Answer


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


Use casting method


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