what happen if I add "main" in "static void sayhello(String name)" as "static void main sayhello(String name)" on the given code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answer
+ 6
An error.
25th May 2020, 2:31 AM
Jayden LeCorps
Jayden LeCorps - avatar