I dont get it.What's wrong with it


#1

import java.util.ArrayList;

public class TemperaturesC {

public static void main(String[] args) {

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

for(int j = 0; j < weeklyTemperatures.size(); j ++)
{
System.out.println( weeklyTemperatures.get(j));
}

}


#2

Hi @aggelos4567,

You are missing a } at the end of the program. See the comments added below …

for(int j = 0; j < weeklyTemperatures.size(); j ++)
{
System.out.println( weeklyTemperatures.get(j));
} // This closes the for loop.

} // This closes the main method.

You need another } at the end of the program to close the block that you opened here, at the beginning of the program …

public class TemperaturesC {

#3

thank you.That really helped me a lot.


#4