Nobel winners in a row
Arrays are very useful for storing values of the same type. They can help you keep information in order, such as the chronological order of your favorite Nobel Prize laureates for Physics!
Diese Übung ist Teil des Kurses
Introduction to Java
Anleitung zur Übung
- Create a
String
arraynobelLaureates
. - Assign the values of
1903
,1921
, and1938
into the arrayyears
.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
class NobelForPhysicsLaureates {
public static void main(String[] args) {
// Create a String array called nobelLaureates
____ ____ = {"Curie", "Einstein", "Fermi"};
// Assign values to years
int[] years ____ ____;
}
}