Print Text with Tab Escape Sequence
This program demonstrates the tab escape sequence.
Problem Statement
Write a Java program that prints text using the tab escape sequence.
Source Code
| 1 | public class TabEscape { |
| 2 | public static void main(String[] args) { |
| 3 | System.out.println("Eduinq\tJava\tPrograms"); |
| 4 | } |
| 5 | } |
Program Output
Eduinq Java Programs
Explanation
The \t escape sequence inserts a tab space between words, so the words are printed separated by tabs, showing how the tab escape sequence can align text.