Print Backslash and Quotes Together

This program prints backslashes and quotes together.

Problem Statement

Write a Java program that prints text with backslashes and quotes.

Source Code

1 public class BackslashQuotes {
2 public static void main(String[] args) {
3 System.out.println("Path: C:\\Eduinq\\\"Java\"");
4 }
5 }

Program Output

Path: C:\Eduinq\"Java"

Explanation

\\ Prints backslash. \" Prints double quotes. Conclusion: Shows how to combine escape sequences for special characters.

Quick Links to Explore