public void startApp() {
    //   
    SecondThread thread = new SecondThread();
    //   
    thread.start();
    //       
    for(int i=1; i<=5; i++)
        System.out.println("Main Thread: "+i);
}

private class SecondThread extends Thread {
    //       
    public void run() {
        for(int i=1; i<=5; i++)
            System.out.println("Second Thread: "+i);
    }
}
