+ 2

what happen if I add "main" in "static void sayhello(String name)" as "static void main sayhello(String name)" on the given code

public class FirstCode { static void sayhello(String name) { System.out.print("Hello" + " " + name); } public static void main(String[] args) { sayhello("Sam"); sayhello("Ram"); } }

25th May 2020, 2:29 AM
Ray
Ray - avatar
1 Odpowiedź
+ 6
An error.
25th May 2020, 2:31 AM
Jayden LeCorps
Jayden LeCorps - avatar