Aan de slagGa gratis aan de slag

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!

Deze oefening maakt deel uit van de cursus

Introduction to Java

Cursus bekijken

Oefeninstructies

  • Create a String array nobelLaureates.
  • Assign the values of 1903, 1921, and 1938 to the array years.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

class NobelForPhysicsLaureates {
    public static void main(String[] args) {
    	
        // Create a String array called nobelLaureates
        ____ ____ = {"Curie", "Einstein", "Fermi"};
    
    	// Assign values to years
        int[] years ____ ____;
	}
} 
Code bewerken en uitvoeren