Reports text blocks that are indented using both space and tab characters. This can produce unexpected results because spaces and tabs are treated equally by javac's text block processing.

在下面的示例中,空格和制表符被分别呈现为 ·,在编辑器中,一个制表符相当于 2 个空格。

示例:


String colors = """
····red
␉ ␉ green
····blue""";

When printing such a string, the result will be:


··red
green
··blue

After the compiler removes an equal number of whitespace characters from the beginning of each line, some lines remain with leading spaces.

2021.1 最新变化