package com.example.domain;

public class HelloWorld {
	public static void main(String[] args) {
		// display message to output
		System.out.println("Hello World!");
//		System.out.println("Hello World!");
//		System.out.println("Hello World!");
		
		// get current/main thread
		Thread t = Thread.currentThread();
		System.out.println(t);
		
		// get thread priority
		System.out.println(t.getPriority());
		
		// set thread priority
		t.setPriority(Thread.MAX_PRIORITY);
		System.out.println("new priority: " + t.getPriority());
		System.out.println(t);
		
		// get thread name
		System.out.println("name: " + t.getName());
		
		// update/change name
		t.setName("first");
		System.out.println("new name: " + t.getName());
		System.out.println(t);
		
		// get id
		System.out.println(t.getId());
		
		for(int i = 0; i < 5; i++) {
			System.out.println(i);
			
			// simulate long running process
			// put thread to sleep
			try {
				Thread.sleep(1000);
				
				System.out.println("thread wakes up!");
				
			} catch (InterruptedException e) {
				// do nothing
				
			}
		}
	}
}
