✏️ Explanatory Question

The following program is wrong. Reorder the lines so that the program displays morning followed by afternoon .

👁 19,906 Views
📘 Detailed Answer
💡

Answer with Explanation

Wrong Order

1 public static void main(String[] args) {
2 }
3 public class Welcome {
4 System.out.println("afternoon");
5 System.out.println("morning");
6 }

Correct Order

public class Welcome {
  public static void main(String[] args) {
    System.out.println("morning");
    System.out.println("afternoon");
  }
}