노벨상 수상자 다시 보기
이전 연습 문제에서 물리학 노벨상 수상자를 살펴봤던 거 기억하시나요? 이제 Fermi보다 Heisenberg를 선호하기로 해서, 기록을 업데이트하려고 합니다.
이 연습은 강의의 일부입니다
Java 소개
연습 안내
nobelLaureates의 세 번째 원소를"Heisenberg"로 바꾸세요.years의 세 번째 원소를1932로 바꾸세요.- 두 배열의 마지막 원소를 출력하도록 print 문을 완성하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
class NobelForPhysicsLaureatesRevisited {
public static void main(String[] args) {
String[] nobelLaureates = {"Curie", "Einstein", "Fermi"};
int[] years = {1903, 1921, 1938};
// Replace Fermi with Heisenberg
____[____] = "Heisenberg";
// Correct the year
years[____] = ____;
System.out.println(nobelLaureates[0] + " won in " + years[0]);
System.out.println(nobelLaureates[1] + " won in " + years[1]);
// Print the last record
System.out.println(nobelLaureates[____] + " won in " + ____[____]);
}
}