Question: Provide a more compact (but functionally equivalent) version of this code fragment: ArrayList students = new ArrayList (); Student student1 = new Student (Alex Trotsky,
Provide a more compact (but functionally equivalent) version of this code fragment:

ArrayList students = new ArrayList (); Student student1 = new Student ("Alex Trotsky", "History"); students.add(student1); Student student2 new Student ("Megan Cooper", "Computer Science"); students.add(student2);
Step by Step Solution
3.33 Rating (159 Votes )
There are 3 Steps involved in it
To create a more compact version of the provided code fragment ... View full answer
Get step-by-step solutions from verified subject matter experts
