![]() ![]() ![]() It is most of the time 4 or 8 spaces long. The second indentation is from the start of character '(' till 'ID'.This can increase or decrease based on various factors such as formatting plugins or the developer’s choice. The first indentation is from the start of the line till the word "CREATE" in all the lines.Here, we have the indentations of two types: ![]() Program output: |CREATE TABLE 'TEST'.'EMPLOYEE' To talk in context, let us refer to the first example. To perform this, JEP divides the space into incidental and essential indentations. The text blocks preserve the indentation of its content. While the above text block looks very simple, still a lot of things happen under the hood. If the text content contains single or double quotes, there is no need to escape them.Content has to start on the next line only. The opening delimiter must be on its own line. We cannot have the delimiters and text blocks on a single line.The opening three double-quote characters are always followed by a line terminator.Text blocks comprise multiple lines of text and use three double-quote characters ( """) as the opening and closing delimiters.It has become a standard feature in Java 15 ( JEP 378). Java text blocks were included in Java 13 ( JEP 355) and Java 14 ( JEP 368) as preview features. It means we do not need to get into the mess of explicit line terminators, string concatenations, and delimiters otherwise used for writing normal string literals. In Java, a text block is a multi-line string literal. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |