5/13 Arraylist: Acces


#1

I dont know if, I'm doing anything wrong. It isn't giving me any error message, it just wont accept my answer as correct.

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

The indentation level for this part is off,


#3

Hi, thanks for replying.
I'm fairly new to coding, so what does that mean?


#4

It should be aligned with this line,

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

#5

I too have the same problem, its not accepting my answer. any solution?


#6

It didn't change anything. It prints out the correct answer but it doesn't accept it as being the right one.


#7

let me see your code now


#8

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