Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Filmography {
- public static void main(String[] args) {
- int k = 0;
- // film list
- String[] films = {"Raiders of the Lost Ark (1981)", "Indiana Jones and the Temple of Doom (1984)", "Indiana Jones and the Last Crusade (1989)"};
- // actors list
- String[][] filmActors = {{"Harrison Ford", "Karen Allen", "Paul Freeman"},
- {"Harrison Ford", "Kate Capshaw", "Ke Huy Quan"},
- {"Harrison Ford", "Sean Connery", "Denholm Elliott"}
- };
- // print headline
- System.out.println("movies and actors: ");
- // print result
- for (int i = 0; i < films.length; i++) {
- System.out.print("In the movie " + films[i] + ", the main actors are: ");
- for (int j = 0; j < filmActors[i].length; j++) {
- System.out.print(filmActors[i][j]);
- if (j < (filmActors[i].length - 1)) {
- System.out.print(", ");
- } else {
- System.out.println(".");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement