My code is this:
public Comparable minimum(Comparable[] inArray)
{
Comparable result = inArray[0];
for(int i = 1; i < inArray.length; i++)
{
if(inArray.compareTo(result) < 1)
{
result = inArray;
}
}
return result;
}
What I want to do is in an array of both doubles / strings (words), I want to find the smallest # in the double array and the first word (in alphabetical order) in the string array
Thanks
public Comparable minimum(Comparable[] inArray)
{
Comparable result = inArray[0];
for(int i = 1; i < inArray.length; i++)
{
if(inArray.compareTo(result) < 1)
{
result = inArray;
}
}
return result;
}
What I want to do is in an array of both doubles / strings (words), I want to find the smallest # in the double array and the first word (in alphabetical order) in the string array
Thanks