Home / MCQ Bank / Computer
Computer Threads

Predict the output: public class Test extends Thread{ private int i; public void run(){ i++; } public static void main(String[] args){ Test a = new Test(); a.run(); System.out.print(a.i); a.start(); System.out.print(a.i); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • Prints

Related Computer Questions

Start / restart the computer is called How can you check if a module is available and can be imported in Python? What is the purpose of the str() function in Python? What is the primary use of the Depth-First Search (DFS) algorithm in graph theory? which extension flash file is to be saved?