Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ArraysNotes2{
- public static void main(String[] args){
- //lets make an array of movie titles
- String[] movieTitles = {"Jaws", "Spaceballs", "Pulp Fiction", "Monty Python and the Holy Grail", "The Notebook"};
- //lets make an array of those movies' ratings
- int[] movieRatings = new int[5];
- movieRatings[0] = 98;
- movieRatings[1] = 59;
- movieRatings[2] = 92;
- movieRatings[3] = 97;
- movieRatings[4] = 53;
- //Print out each movie's title and rating
- System.out.println( movieTitles[0] + " received a " + movieRatings[0] );
- System.out.println( movieTitles[1] + " received a " + movieRatings[1] );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement