Skip to content

Commit 6dbedfd

Browse files
committed
Solved NoSuchElementException
1 parent c0ebbb7 commit 6dbedfd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

bin/org/input4j/Input.class

276 Bytes
Binary file not shown.

src/org/input4j/Input.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ public static Character Char(String menssage) {
2727
public static String Str(String menssage) {
2828
Scanner rr = new Scanner(System.in);
2929
System.out.printf(menssage);
30-
String s = rr.nextLine();
31-
rr.close();
30+
String s = rr.next();
31+
32+
if(rr.hasNextLine()) {
33+
s += rr.nextLine();
34+
}
35+
3236
return s;
3337
}
3438

0 commit comments

Comments
 (0)