All pastes #626896 Raw Edit

Jemand

public java v1 · immutable
·published 2007-07-19 23:08 UTC
rendered paste body
import java.util.ArrayList;import java.lang.*;import javax.swing.JOptionPane;public class Stoppuhr {        static long millis = System.currentTimeMillis();        static long laufzeit = Integer.valueOf(JOptionPane.showInputDialog("Laufzeit"));    static long trigger = Integer.valueOf(JOptionPane.showInputDialog("Trigger"));    static ArrayList speicher = new ArrayList();        public static void main(String[] args) throws InterruptedException {        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);        }            }}