Skip to content

Commit 6b758bd

Browse files
committedJun 29, 2020
fix Scanner bug
1 parent af3f177 commit 6b758bd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎ch06/Strings.java

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static void main(String[] args) {
3838
System.out.print("Enter a number: ");
3939
}
4040
double number = in.nextDouble();
41+
in.nextLine(); // read the newline
4142

4243
// String iteration
4344

0 commit comments

Comments
 (0)
Please sign in to comment.