What if I want to print out on the screen a text with quotes "inverted commas" in java. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What if I want to print out on the screen a text with quotes "inverted commas" in java.

want to see "Hello World!" not Hello World

4th Nov 2016, 11:21 AM
Annie
Annie - avatar
6 Answers
+ 2
Use \" for double inverted commas and \' for single hope it helps you
4th Nov 2016, 11:24 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 1
how you implement it, it should be like this System.out.print("\"Hello\"");
4th Nov 2016, 3:20 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 1
does this work?
4th Nov 2016, 3:24 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 1
public class Program { public static void main(String[] args) { System.out.print("\"Google\" is a search engine and I \"love\" to use it."); } }
4th Nov 2016, 3:25 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
0
nope... doesn't work 😣😓
4th Nov 2016, 3:14 PM
Annie
Annie - avatar
0
yes worked! you are great!! thanks a lot!!
4th Nov 2016, 3:27 PM
Annie
Annie - avatar