T Thịnh Võ Member Sep 19, 2021 #1 What is the name of the thread in the following Java Program? Code: class multithreaded_programing { public static void main(String args[]) { Thread t = Thread.currentThread(); System.out.println(t); } } A. main B. Thread C. System D. None of the mentioned
What is the name of the thread in the following Java Program? Code: class multithreaded_programing { public static void main(String args[]) { Thread t = Thread.currentThread(); System.out.println(t); } } A. main B. Thread C. System D. None of the mentioned
T Tạ Bích Hạnh Member Sep 19, 2021 #2 Answer: a Explanation: The output of program is Thread[main,5,main], Since we have not explicitly named the thread they are named by the group to they belong i:e main method. Hence they are named ‘main’. Output: Code: $ javac multithreaded_programing.java $ java multithreaded_programing Thread[main,5,main] This section of our 1000+ Java MCQs focuses on networking basics of Java Programming Language. Upvote 0 Downvote
Answer: a Explanation: The output of program is Thread[main,5,main], Since we have not explicitly named the thread they are named by the group to they belong i:e main method. Hence they are named ‘main’. Output: Code: $ javac multithreaded_programing.java $ java multithreaded_programing Thread[main,5,main] This section of our 1000+ Java MCQs focuses on networking basics of Java Programming Language.