I want to initialize a String in Java, but that string needs to include quotes; for example: "ROM"
. I tried doing:
String value = " "ROM" ";
but that doesn't work. How can I include "
s within a string?
In Java, you can escape quotes with \
:
String value = " \"ROM\" ";