Select the only true option of compilation and running the code.

public class MyThread extends Thread {
    public static void main(String[] args) {
        new MyThread().start();
    }
}
Explanation
Starting a new thread executes the code that is located in the method run(). MyThread class inherits from the Thread class the empty method run() - so a new thread will bring nothing and just completes its work, and after the whole application will finish its work.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Java
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести