3/13, ArrayList


#1

What is wrong with my code?

Instructions: Inside of the main method, create an ArrayList object called weeklyTemperatures that will store Integer data types.

import java.util.ArrayList;

public class Temperatures {
    
    public static void main(String[] args) {
ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer> ();

    }
}

#2

Err: ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer> ();

At the end of the statement,  () this brackets must be written without blank space after " new ArrayList<Integer>"
so:
ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer>(); //this will be ok ;)

#3

HELP!! ArrayList 3/13 what's wrong with this code
:point_down:
{ ArrayList weeklyTempretures = new ArrayList();


#4

Figured it out it's the Tempreture instead of Temperature. Moving on now :wink:


#5

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