-Define the data type -Define variable names
//Data type=String, variable name=array
String[] array;
-Define the number of elements
//Element count=3
String[] array = new String[3];
・ No need to define the number of elements -Define elements that match the data type
//Element 0="a", Element 1="b", Element 2="c"
String[] array = {"a","b","c"};
Recommended Posts