Java tutorial
public class Main { public static void main(String[] args) { // Create a Thread object Thread t = new Thread(Main::print); // Start the thread t.start(); } public static void print() { for (int i = 1; i <= 5; i++) { System.out.print(i + " "); } } }