What is the result of the following code execution?

public class TestThread extends Thread { 
    public void run() { System.out.println( "Run!" ); } 
    public void begin() { System.out.println( "Begin!" ); } 
    public void execute() { System.out.println( "Execute!" ); } 

    public static void main( String[] args ) { 
        TestThread myTest = new TestThread(); 
        myTest.start(); 
    } 
}
Explanation
Run! is the correct answer since run() method is executed when thread is started after start() method is called.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты