0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

文字列の連結と改行

Posted at
filename.rb
class Abc
    public static void main(String[] args) {
        System.out.println("こんにちは。" + "元気ですか?\n僕は元気です。");
    }
}

文字列を連結するには「+」を使用する。
文字列リテラルの途中で改行ができないため、文字列が長くて1行に入りきらない時に使用するとインデントを綺麗にすることができる。
改行するには「\n」という改行文字も利用できる。
この場合「僕は元気です。」が改行されて表示される。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?