I. Concepts and usage
Left Right counter
Let's take a look at the concept of escape characters: through \,? To change the meaning of the letter or symbol behind it. It means to change the meaning of the letter itself.
Take the "\" symbol for example, there are many operations in Java, such as file operations, need to use the path of this thing, than
such as: Com\mypackage\xxx.xml, this path is generally expressed in string form,
But the question is, Java does not know whether your number is the next level in the path, or the meaning of the string "\".
Forward slash/denote division, delimited. Typically used in Windows systems to separate command-line arguments,/indicate options, and so on. cannot be a file name.
Backslash \, used in Windows system to represent the directory.
In the UNIX system, the/represents the directory. Because the web follows UNIX naming, in the URL (URL),/represents the directory.
\ is an escape character in C #
The following is a chart of the Java Transit characters
Second, the problems encountered in the actual development
Specify when to upload the picture why is the \ \ Escape to \ Local path with ' \ ' expression?
Windows uses backslashes ("\") to indicate that a path's history comes from DOS, while another tradition of DOS is to use a slash ("/") to denote command-line arguments, such as: CD%systemdrive%dir/s/b shell32.dll since the DOS side slash is occupied, Had to find the closest one. That's it. In UNIX environments, we use a minus sign ("-") and a double minus sign ("--") to represent command-line arguments. Using a slash to indicate a command-line argument is a compatibility reason. The problem originally originated with IBM. IBM contributed a large number of tools when it first joined DOS development by using slashes to handle command-line arguments. This tradition stems from dec/ibm, such as the VMS that used to handle command-line arguments with slashes, whose directory delimiter is the dollar symbol ("$"). By the way, this tradition has also been partially inherited into DOS and windows, and the Japanese version of Windows displays the backslash as "¥" on the screen, although it is actually a backslash. Today's Windows kernel can actually support both slash and backslash when working with paths. Many times we see errors when using slashes because of application-level reasons. For example, Cmd.exe does not support using a slash to represent the path, and PowerShell.exe supports it, and for this reason PowerShell begins to use the minus sign as the starting character for the command line arguments.
Local resource Path && network resource path && use of backslashes in Java