Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.mycompany.app5;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- /**
- *
- * @author Admin
- */
- public class MyTask implements Runnable{
- @Override
- public void run() {
- //
- System.out.println("MyTask");
- for (int i = 0; i < 10; i++) {
- System.out.println("MyTask.i=" + i);
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ex) {
- ex.printStackTrace();
- System.out.println("exception in MyTask!");
- return;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement