87.5k views
21 votes
What is the output of the code?

public class trackList
public static void main(StringD args)
ArrayList track new ArrayListcinteger)
track.add(45);
track.add(55);
track.add(85);
System.out.print(track);
runtime error
45
55
85
compiler error

User Shaheed
by
3.8k points

1 Answer

6 votes

Answer:

45, 55, and 85

Step-by-step explanation:

The Java program is complete and logically correct. It creates and adds integer values to an array list. The 'System.out.print' function of the track array variable would not throw any error but output the list of integer values.

User Kojiwell
by
3.3k points