+ 1
What does it mean it should be escaped ??
3 ответов
+ 4
There are some special characters which should be escaped if we want to use them in strings.
For example, when we want to define path to a file we can't just write
String path = "c:\Temp\file.txt";
because \ character should be escaped as follows:
String path = "c:\\Temp\\file.txt";
Another example:
Let us assume we need to output "To be or not to be".
Here, the double quote charachters should be escaped:
System.out.print("\"To be or not to be\"");
+ 15
When you want a special character to be considered a normal one you have to escape it (put a "\" backslash before it.). Mostly used in RegEx...
+ 2
thanks guys , I got it