Skip to content

Commit b906fc4

Browse files
Update StackArray.java
1 parent 4db889f commit b906fc4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

StackArray.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ public int StackMenu(){
123123
System.out.println("STACK OPTIONS: ");
124124
System.out.println("1.PUSH 2.POP 3.PEEK 4.SIZE 5.DISPLAY 0.EXIT");
125125
String in = SafeInput();
126-
if(in=="invalid")
126+
if(in=="invalid"){
127127
return -1;
128+
sc.nextLine();
129+
}
128130
else return Integer.parseInt(in);
129131
}
130132

0 commit comments

Comments
 (0)