Hi all, im very new to java
i would like to know how to add the following objects into an array
CD cd1 = new CD("Kaiser "," up the khazi ", 9.99);
CD cd2 = new CD("Oasis "," morning glory ",3.99);
CD cd3 = new CD("Bob Dylan "," Alreet Sunna ",6.99);
i know i need to declare a variable, but i dont know what kind as the object has String and double.
im trying to achieve the following:
declare and set max (using cd[0].getCost())
declare and set maxIndex
for each remaining CD
If CD cost is bigger than max
Set max to bigger value
Set maxIndex
output result