What will be the result of compiling the following code:

public class ThreadTest {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(new TestThread());
        System.out.println("Hello, it's a main thread");
        System.out.println("Good bye");

class TestThread implements Runnable {

    public void run() {
        System.out.println("Hello, it's a simple thread");

    public void join() {
        System.out.println("Hello, it's a method join()");

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Sign Up Now
or Subscribe for future quizzes