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 3 years have passed since last update.

【Java】配列を宣言・初期化する

Last updated at Posted at 2020-04-26

#配列を宣言する
・データ型を定義する
・変数名を定義する

//データ型=String、変数名=array
String[] array;

#配列を初期化する
・要素数を定義する

//要素数=3
String[] array = new String[3];

#配列を要素にデータを詰めて初期化する
・要素数の定義は不要
・データ型に一致する要素を定義する

//要素0="a"、要素1="b"、要素2="c"
String[] array = {"a","b","c"};
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?