Question: Hey there, can someone pls provide a solution to this? Thanks in advance! * In the Question 2 class, write a method 'longestTrack' that takes

Hey there, can someone pls provide a solution to this?

Thanks in advance!

Hey there, can someone pls provide a solution to this? Thanks inadvance! * In the Question 2 class, write a method 'longestTrack' that

* In the Question 2 class, write a method 'longestTrack' that takes * an ArrayList of Tracks in an album (defined in the Track class), *as input and returns the track in the album with the *longest duration * If the list of tracks is empty, the method should return null *Eg: tk * ArrayList starWars new ArrayList() * Track track1 new Track ("Main Title", 134); * Track track2 new Track("Imperial Attack", 403); * Track track3 new Track("The Dune Sea", 382); *starWars.add(track1); * starWars.add(track2); * starWars.add (track3); * Track longestQuestion2.longestTrack (starWars); *System.out.println(longest.getTitle)): * This should print "Imperial Attack". public class Question2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!