Datentyp [] Array name = {};
String[] names = {"tanaka" , "sato" , "suzuki"};
System.out.println(names[0]);
Geben Sie den gesamten Inhalt des Arrays aus.
** Normal für Aussage **
String[] names = {"tanaka" , "sato" , "suzuki"};
for(int i = 0; i < names.length; i++) {
System.out.println(names[i]);
}
** Zur Aussage erweitert **
for (Datentypvariable: Arrayname) {}
String[] names = {"tanaka" , "sato" , "suzuki"};
for(String name:names) {
System.out.println(name);
}
Recommended Posts