5/13


#1

https://www.codecademy.com/en/courses/learn-java/lessons/data-structures/exercises/arraylist-access

its printing out 67 but its telling me that i am not printing the lowest number.

import java.util.ArrayList;

public class Temperatures {
	
	public static void main(String[] args) {

    ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer>();
weeklyTemperatures.add(78);
weeklyTemperatures.add(67);
weeklyTemperatures.add(89);
weeklyTemperatures.add(94);

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

#2

It could be a simple matter of unexpected white space in your code.

as opposed to,

    System.out.println(weeklyTemperatures.get(1));

#3

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