The following table describes the widely used Unicode Character Sequence. List of Unicode Character or Escape Sequence While interpreting the string if the compiler finds something in the Unicode representation, the compiler replaces it with a respective symbol according to the Java specification. Here, \uxxxx represents \u0000 to \uFFFF. A Unicode escape character consists of a backslash (/) followed by one or more u characters and four hexadecimal digits ( \uxxxx). Java also supports Unicode escape characters. Suppose, we have to print the following statement with double quotes: Let's understand the uses of escape characters through the following example. It is used to insert a backspace in the text at this point. It is used to insert a form feed in the text at this point. It is used to insert a new line in the text at this point. It is used to insert a backslash character in the text at this point. It is used to insert a carriage return in the text at this point. It is used to insert a double quote character in the text at this point. It is used to insert a single quote character in the text at this point. It is used to insert a tab in the text at this point. In Java, there is a total of eight escape sequences that are described in the following table. The Java compiler interprets these characters as a single character that adds a specific meaning to the compiler. Remember that escape characters must be enclosed in quotation marks (""). It may include letters, numerals, punctuations, etc. In Java, if a character is preceded by a backslash (\) is known as Java escape sequence or escape characters. Also, we will use these escape sequences or characters in a Java program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |