Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.up;
- import java.util.Timer;
- import java.util.TimerTask;
- public class Main {
- public static void main(String[] args) {
- Timer timer = new Timer();
- Kwadrat kwadrat = new Kwadrat(2);
- System.out.println("Przed przeskalowaniem: " + kwadrat.getPole());
- final int[] t = {0};
- timer.schedule(new TimerTask() {
- @Override
- public void run() {
- kwadrat.rescale(2);
- System.out.println("Po przeskalowaniu: " + kwadrat.getPole());
- t[0]++;
- if (t[0] == 4) {
- timer.cancel();
- }
- }
- }, 0, 3600);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement