I'm basically making a clock and I want a specific input to be able to stop it. any ideas?
here's my code:
public static void main(String[] args) { ... Scanner input = new Scanner(System.in); ... int s = 0; int m = 0; int h = 0; clock: // label to break a outer most loop for(int i = 0; i<2; i++) { on = Boolean.parseBoolean(onValue[i]); while (on = true) { for (i=1; i<=60; i++) { s++; if(input2check.compareTo("") == 0) { on = Boolean.parseBoolean(onValue[1]); break clock; } if (s == 60) { s = 0; } System.out.println(s + " sec" ); } } } }
2.1m questions
2.1m answers
60 comments
57.0k users