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."); } }
3 Antworten
+ 5
Pasting the code here would be a great start
+ 4
Remember that you need to enter all your imputs separated by a enter (in another line) at the start, all at once here.
+ 1
Wow I just understood finally it was about receiving input from the user. Break through. Thanks for all help.