Skip to content

Commit c0ebbb7

Browse files
committed
Solved nextLine error!
1 parent fb20a93 commit c0ebbb7

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

bin/org/input4j/Input.class

-21 Bytes
Binary file not shown.

src/org/input4j/Input.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@ public static Character Char(String menssage) {
2323
return c;
2424
}
2525

26+
//Impossivel utilizar o mesmo objeto dos outros inputs
2627
public static String Str(String menssage) {
28+
Scanner rr = new Scanner(System.in);
2729
System.out.printf(menssage);
28-
29-
//Corrige erro de pular leitura
30-
if(read.hasNext()) {
31-
read.nextLine();
32-
}
33-
34-
String s = read.nextLine();
30+
String s = rr.nextLine();
31+
rr.close();
3532
return s;
3633
}
3734

0 commit comments

Comments
 (0)