Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Scanner lukija = new Scanner(System.in);
  2. List<int> lista = new ArrayList<>();
  3. System.out.println("Syötä luvut: ");
  4. int muuttuja1;
  5. while (true) {
  6. muuttuja1 = Integer.parseInt(lukija.nextLine());
  7. if (muuttuja1 != -1) {
  8. lista.add(muuttuja1);
  9. } else {
  10. break;
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement