5/13 Data Structures


#1

HERE IS MY CODE:
import java.util.ArrayList;

public class Temperatures {

public static void main(String[] args) {

ArrayList weeklyTemperatures = new ArrayList();

weeklyTemperatures.add(78);
weeklyTemperatures.add(67);
weeklyTemperatures.add(89);
weeklyTemperatures.add(94);

System.out.printIn( weeklyTemperatures.get(1) );
}
}

The error message states: "Did you print out the lowest temperature? Use the example to help you."

What am I doing wrong????


#2

Shouldn't you be using....
ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer>();


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.