Dremendo Tag Line

Print text on separate lines in Java

Java Output - Question 1

In this question, we will see how to print multiple text on separate lines in java programming using the java output. To know more about java output click on the java output lesson.

Q1) Write a program in java to print the name of 5 countries on separate lines on the screen.

Program

public class Q1
{
    public static void main(String args[])
    {
        System.out.println("India");
        System.out.println("Australia");
        System.out.println("England");
        System.out.println("United States of America");
        System.out.println("China");
    }
}

Output

India
Australia
England
United States of America
China
video-poster