Dremendo Tag Line

Print string with tabs in Java

Java Output - Question 2

In this question, we will see how to print string with tabs in java programming using the java output. To know more about java output click on the java output lesson.

Q2) Write a program in java to print the name of 3 animals in a single line on the screen using tabs between the names.

Program

public class Q2
{
    public static void main(String args[])
    {
    	System.out.println("Tiger\tElephant\tLion");
    }
}

Output

Tiger   Elephant        Lion
video-poster