Advertisement
jaVer404

level16.lesson03.task01

Aug 13th, 2015
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. package com.javarush.test.level16.lesson03.task01;
  2.  
  3. /* My first thread
  4. Создать public static class TestThread - нить с помощью интерфейса Runnable.
  5. TestThread должен выводить в консоль "My first thread".
  6. */
  7. public class Solution {
  8.     public static void main(String[] args) {
  9.         TestThread task = new TestThread();
  10.         new Thread(task).start();
  11.     }
  12.     public static class TestThread implements Runnable {
  13.         @Override
  14.         public void run()
  15.         {
  16.             System.out.println("My first thread");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement