I did an assignment that has the following code in it
int status;
Object[] Data = new Object[3];
message.readArray(Data, 0, 3) //this is a call to an external library that reads some values (all integers) into 'Data'. 0 is the start and 3 is the count
status = (int) Data[2];
From searching, I found that the last line should be something like
status= ((Integer)Data[2]).intValue();
Now the problem is that the initial code compiled and run without issues using ANT, but my evaluator gets the error:
java:146: inconvertible types
[javac] found : java.lang.Object
[javac] required: int
[javac] status = (int) Data[2];
[javac] ^
I’m not sure what version of ANT and/or JAVA he is using, but mine is ANT 1.7.1 and JAVAC 1.7.0. Does anyone know why this seems to be a problem on their end and why it compiles on mine?
This would be the java version not the ANT version. Make sure he is using the same version of JAVAC as you.