Print Backspace Escape Sequence
This program demonstrates the backspace escape sequence.
Problem Statement
Write a Java program that prints text using the backspace escape sequence.
Source Code
| 1 | public class BackspaceEscape { |
| 2 | public static void main(String[] args) { |
| 3 | System.out.println("Eduinq\bPrograms"); |
| 4 | } |
| 5 | } |
Program Output
EduinPrograms
Explanation
The \b escape sequence removes the previous character, so the 'q' before Programs is removed from the output, showing how the backspace escape sequence modifies output.