problem compiling with codeplayground. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

problem compiling with codeplayground.

A piece of Code that compiled and worked correctly with netbeans Ide failed to work when I tried running it with our sololearn codeplayground. Can some body help me? Here is my code: import java.util.Scanner; public class HappyNewYear { public static void main(String[] args) { // int newYear = 2017; String name; Scanner sc = new Scanner(System.in); System.out.println("What is your name?"); name = sc.next(); System.out.println("Enter new year: "); newYear = sc.nextInt(); System.out.println("Happy new year "+newYear+" to you "+name+" and your entire family."); } }

31st Dec 2016, 9:57 AM
koki Christopher Titewondze
koki Christopher Titewondze - avatar
3 Answers
+ 5
Pasting the code here would be a great start
31st Dec 2016, 9:11 AM
Dao
Dao - avatar
+ 4
Remember that you need to enter all your imputs separated by a enter (in another line) at the start, all at once here.
31st Dec 2016, 10:10 AM
Nahuel
Nahuel - avatar
+ 1
Wow I just understood finally it was about receiving input from the user. Break through. Thanks for all help.
11th Jan 2017, 6:32 AM
koki Christopher Titewondze
koki Christopher Titewondze - avatar