Home / Questions / The following program is wrong. Reorder the lines so that the program displays morning followed by afternoon .
Explanatory Question

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

👁 19,903 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

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");
  }
}