Skip to content

Commit cdbe1cc

Browse files
committed
feat: Print string with both single and double quotes using escape characters [escape-nested-quotes]
🔑 Key: escape-nested-quotes 🧠 Logic: - Uses `\"` to escape the double quotes around the inner dialogue. - The single quote in `It's` doesn't need to be escaped inside double-quoted strings. - Demonstrates the proper use of escape characters when mixing quotes. 📘 Example Use: - Useful for printing code, dialogues, or quotes that contain both types of quotes. Signed-off-by: Somesh diwan <[email protected]>
1 parent a5d0838 commit cdbe1cc

File tree

1 file changed

+6
-0
lines changed
  • JDK Features/Escape Sequences in Java/src

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Code6 {
2+
public static void main(String[] args) {
3+
// write your code here
4+
System.out.println("The programmer exclaimed - \"It's amazing how Python handles special characters!\"");
5+
}
6+
}

0 commit comments

Comments
 (0)