Question: Write a program that adds the numbers 1 through 5 into the numbers ArrayList and then prints out the first element in the list. import

Write a program that adds the numbers 1 through 5 into the numbers ArrayList and then prints out the first element in the list.

import java.util.ArrayList;

public class MyProgram extends ConsoleProgram
{
public void run()
{
ArrayList numbers = new ArrayList();
// Add 5 numbers to `numbers`

// Print out the first element in `numbers`
}
}

Step by Step Solution

3.53 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautilArrayList public class MyProgram extends Console... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!