returnTwo

In this problem, you're practicing how to instantiate a list in Java as well as how to use the add method.

Complete the method returnTwobelow that returns a list containing two integers 5 and 4 in that order.

Syntax:
ArrayList<DataType> name = new ArrayList<DataType>();

To add to a list, use the add method of the list. 
Example:
ArrayList<String> names = new ArrayList<String>();
names.
add("Jill"); 

The following are methods of a list that can be used to manipulate the contained data.


Type your solution        
Skills Practiced:
3.D
4.A
4.B
Copyright © StudyCS 2024 All rights reserved.