asked 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

asked
User Shaheed
by
8.6k 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.

answered
User Kojiwell
by
8.6k points