public class Solution {
public static void main(String[] args) {
//write your code here
System.out.println("This is a Windows path: "C:\\Program Files\\Java\\jdk1.8.0_172\\bin"");
System.out.println("This is a Java string: \\"C:\\\\Program Files\\\\Java\\\\jdk1.8.0_172\\\\bin\\\"");
}
}
I am getting a compiler error at jdk1.8.0_172\\bin but I cannot work out how to fix it
Where am I going wrong compile error
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Sarah Suß
23 November 2019, 13:58
To display quotation marks inside a string, you need to write \"
So your first print statement should be:
System.out.println("This is a Windows path: \"C:\\Program Files\\Java\\jdk1.8.0_172\\bin\"");
0