Final answer:
The correct answer is option C) for (int i = 0; i < 10; i++) { System.out.println(Math.random() > 0.5 ? "Heads" : "Tails"); }. This option uses the Math.random() method to generate a random number between 0 and 1 and displays the result of a coin toss 10 times.
Step-by-step explanation:
The correct answer to this question is option C) for (int i = 0; i < 10; i++) { System.out.println(Math.random() > 0.5 ? "Heads" : "Tails"); }
This option uses the Math.random() method to generate a random number between 0 and 1. If the generated number is greater than 0.5, it prints "Heads", otherwise it prints "Tails". This simulates a coin toss and randomly displays the result of a coin toss 10 times.