Form Feed in JavaForm feed character is one of the escape sequence characters it is denoted by "\f". It is an old strategy and used to show a page break. ExampleOutput: Escape Sequences in JavaA character with an oblique punctuation line (\) not long before it is an escape sequence or escape character. We use escape sequence to play out some specific task. Unquestionably the quantity of departure characters or break arrangements in Java is 8. Each getaway character is a substantial person strict. Example program to show the use of escape sequences: Output: This happened in light of the fact that the compiler expects only possibly strings inside the quote, yet when the compiler finds a quote, it expects another quote sooner rather than later (the end one), and between them, the line of text ought to be made. During this case, the quotes "Welcome to JavaTpoint tutorials and examples" gets nested (inside other quotes). When the compiler arrives here, the compiler gets befuddled. As per the standard, the quote recommends the compiler for making a string, yet the compiler was occupied with doing that thing beforehand, and the code gives us a compile-time blunder. So we ought to give appropriate directions to the compiler about the quote. i.e., when a citation is utilized for making a string (as an order) and when it is a person itself (the piece of the result string). Comparable kinds of disarray emerge with different characters also (like backslashes (), single and twofold quote (', ")), and these likewise give a compile time blunder for each situation. To address such issues, we need to utilize the java character away. Control SequencesA control sequence isn't anything anyway. The backslash(\) stuck with a person (the character which must be gotten away) is known as a control sequence. Example Output: Types of Escape Sequences1. \t: It is utilized to embed a tab in the text between the words. Example program for \t in java Output: 2. \b: The escape character \b is a delete character It moves the cursor one character back despite everything erasing the character(depending upon the compiler) Example program for \bin Java: Output: 3. \n: \n is used to print the sequence of the character of a character in the new line. Example program for\n in java Output: 4. \r: This \r get away from succession is a carriage return character. It moves the result guide back toward the start of the line without dropping down the line (for the most part). Example program for \r in java Output: 5. \f: This \f escape character is a form feed character. It is an old strategy and used to show a page break. Example program for \fin java Output: 6. \': This \' escape character is for displaying a solitary quote on the text string Example program for \' in java Output: 7. ": This \' escape character is for displaying a two-fold quote on the text string. Example program for \" in java Output: 8. \\: This \\ escape character is used to display a backslash line on the text string in the output screen. Example program for \\ Output: It contains two oblique punctuation lines. This implies subsequent to perusing the first \. The compiler read the following \ as another character. Next TopicJava Clone Examples |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India