All pastes #626917 Raw Edit

Jemand

public java v1 · immutable
·published 2007-07-19 23:28 UTC
rendered paste body
import java.util.ArrayList;import java.lang.*;import javax.swing.JOptionPane;public class Stoppuhr {    static long millis;    static long laufzeit = Integer.valueOf(JOptionPane.showInputDialog("Laufzeit"));    static long trigger = Integer.valueOf(JOptionPane.showInputDialog("Trigger"));    static ArrayList<Integer> speicher = new ArrayList<Integer>();        public static void main(String[] args) throws InterruptedException {        millis = System.currentTimeMillis();        ArrayFuellen(laufzeit, trigger);        for(int i = 0; i < speicher.size(); i++)            System.out.println(speicher.get(i));            }        public static void ArrayFuellen(long laufzeit, long trigger) throws InterruptedException {        int i = 1;        while((System.currentTimeMillis() - millis) <= laufzeit) {            speicher.add(i);            i = i * 2;            Thread.sleep(trigger);        }    }}