The compiler detected an attempt to cast the return value of a method call to void. Casting a method call to void is not allowed in the Java language. Remove the void cast for the method call specified by the error and compile again.
The following examples illustrates this error:
public class Simple{
public void method1(){
//Do something meaningful here
}
public static void main (String args[]){
Simple smp = new Simple();
(void) method1();
//error: cannot cast method's return value to 'void'.
}
}