sorry i'm new to this forum and first time posting so bare with me for the long post for just a simple question.
i've been asked to write a piece of array code that gets 5 numbers from user and then display the highest number inputted.
here is my code:
public class Math2
{
private int[] Math2;
public Math2()
{
}
public int getHighest(int[] Math2)
{
java.util.Arrays.sort(Math2);
int largest = Math2[Math2.length-1];
return largest;
}
}
now my code works fine but here
comes the problem... i've been given a unit test to test my code, and whats happening is that they dont mix lol, i've been getting error and i have no idea how to get this fixed
unit test code is this:
public void testHighestFirst()
{
Math2 math1 = new Math2(new int[]{5, 1, 2, 4, 3});
assertEquals(5, math1.getHighest());
}
the error i'm getting is this:
"cannot find symbol - constructor Math2(int[])"
what can i do to get this fixed? ( i use blue J if thats even relevant at all)