Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RunThread extends Thread{
- public RunThread(){
- }
- @Override
- public void run() {
- for(int i = 1;i<=20;i++){
- System.out.print(i + " * ");
- try {
- Thread.sleep(500);
- }
- catch(InterruptedException e){
- e.printStackTrace();
- }
- }
- for(int k = -20;k<=-1;k++){
- System.out.println("<>"+k);
- try {
- Thread.sleep(500);
- }
- catch(InterruptedException e){
- e.printStackTrace();
- }
- }
- }
- public static void main(String[] args){
- new RunThread().start();
- }
- }
Add Comment
Please, Sign In to add comment