
Robert E. answered 01/23/15
Tutor
5.0
(176)
Software Development
Zargham, I am new to wyzant so I will try and assist you on your question while at the same time adhere to academic honesty. There are several examples on the Internet that show you how you can perform this exercise.
If this is for a class, then can you utilize Java Collections instead of Arrays. Arrays are from the past, they are fixed (not dynamic). Collections are dynamic Object Oriented Java classes that perform everything that you wish in a few lines of code.
Once you try a simple example, you should see how much easier and straight forward this is, go here:
http://www.tutorialspoint.com/javaexamples/java_collections.htm
Simply put. You would build an object of type class of MP3, e.g. MP3.java
public class MP3 {
private int trackNumber = 0;
private String artist = "";
private String artist = "";
private String band = "";
private double duration= 0;
// Constructor here
public MP3(int trackNumber, ...) {
}
put all your accessor / mutator methods here
}
Then create your other class to manipulate the data.
public class MP3_Catalog {
List<MP3> mp3 = new ArrayList<MP3>();
...
then you can sort, reorder, select specific records, manipulate everything using OO principals.
I can write up a simpler example if the website was not straight forward and yes, use eclipse.