0

Why cannot get output at code playground?

class MyClass { public static void main(String[ ] args) { String name ="David"; } } This is the code I entered, but the output showed 'no output' Why? Thanks

14th Feb 2017, 12:16 PM
freedom
2 Answers
+ 6
You have to print the variable to the console. In C#: Add Console.WriteLine(name);
14th Feb 2017, 12:26 PM
Jafca
Jafca - avatar
+ 3
You forgot to add this line: System.out.println(name);
14th Feb 2017, 12:26 PM
Ghauth Christians
Ghauth Christians - avatar