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!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antwort
+ 6
An error.
25th May 2020, 2:31 AM
Jayden LeCorps
Jayden LeCorps - avatar