Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 509 Bytes

02. Text Blocks.md

File metadata and controls

19 lines (16 loc) · 509 Bytes

Text Blocks

  • Beginning with JDK 15, java supports text blocks.
  • it is a new kind of literal that is composed of a sequence of characters that can occupy more than one line.
class Main{
    public static void main(String[] args){
        String message = """
                Hello John,
                This is a simple text block demo.
                it supports multiline texts
                no more "\\n" in the texts.
                """;
        System.out.println(message);
    }
}