+ 1
Hello again ! I've made a program which is supposed to read the Input and add " Welcome," to it, but it ain't workin :/
import java.util.Scanner; class MyClass { public static void main(String[] args) { Scanner myVar = new Scanner(System.in); System.out.printIn( " Welcome, " + MyVar.nextLine()); } } Thanks for any help :3
10 Antworten
+ 4
I have found the error:
Not myVar.nextLine() is out of printstream but printIn.
In your code you are using i (I) but it is a small L (l).
In capital letters: PRINTLN
+ 3
I can not really explain why it is not working. It has to do with the println() method/print stream.
String str = myVar.nextLine();
System.out.println("Welcome " + str);
+ 3
Yes.
+ 3
Forget my post. I don't know why but when I tried your code I got an error message. But I tried an own code it works:
https://code.sololearn.com/c7jlJ9e7pFM1/?ref=app
+ 2
That's why none of my codes work !
+ 2
Thx lol
+ 2
second
you declare myVar but call uppercase MyVar.
+ 1
Oh so if I get it right you have to save the " MyVar.nextLine " as a String to be able to use it ?
+ 1
Oooooh
+ 1
Oh ye, didn't even notice that. Thanks !