LoginSignup
0
0

More than 3 years have passed since last update.

Java Stringクラスについて

Posted at

勘違いしていたので整理するために投稿しています。

String name = "田中君";
String name = new String("田中君");
これら2つは同じ意味であり、文字列は多く使う事があるため特別に
String name = "田中君";での入力が可能である。

つまり文字列オブジェクトとなり変数nameに田中君が代入されている訳ではなくnameには参照データが格納されている。

0
0
4

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