![見出し画像](https://assets.st-note.com/production/uploads/images/130613173/rectangle_large_type_2_7f697541ea205fab362780c1e8ead902.png?width=1200)
【Java】文字を格納する型
文字を格納する型
String型 は文字列(0文字以上の文字の集まり)を代入できます。
サンプルプログラム
public class j015 {
public static void main(String[] args) {
String message;
message = "テスト!";
System.out.println(message);
}
}
実行結果
![](https://assets.st-note.com/img/1707712210677-CMyLQwqSAc.png)
テスト!
文字列データ を記述する場合は二重引用符" を使います。