+ 1
Can we change david and ami in the program to numericals
class MyClass { static void sayHello(String name) { System.out.println("Hello " + name); } public static void main(String[ ] args) { sayHello("David"); sayHello("Amy"); }
3 Réponses
+ 2
you can only send string types to your function sayHello
0
Change "static void sayHello(String name)" with "static void sayHello(int numerical)" (or float or double instead of int)
0
in that case @ Leonardo .do we get the output as the sum of the numbers placed side by sibe