Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. package com.up;
  2.  
  3. import java.util.Timer;
  4. import java.util.TimerTask;
  5.  
  6. public class Main {
  7.  
  8.     public static void main(String[] args) {
  9.         Timer timer = new Timer();
  10.         Kwadrat kwadrat = new Kwadrat(2);
  11.         System.out.println("Przed przeskalowaniem: " + kwadrat.getPole());
  12.         final int[] t = {0};
  13.         timer.schedule(new TimerTask() {
  14.             @Override
  15.             public void run() {
  16.                 kwadrat.rescale(2);
  17.                 System.out.println("Po przeskalowaniu: " + kwadrat.getPole());
  18.                 t[0]++;
  19.                 if (t[0] == 4) {
  20.                     timer.cancel();
  21.                 }
  22.             }
  23.         }, 0, 3600);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement