Compiler Error J0108

Cannot 'new' an instance of type 'identifier'

The compiler detected an attempt to instantiate a data type that does not require the use of the keyword new. This error usually occurs when an attempt is made to use the new keyword with an intrinsic data type and the declaration is not an array. Ensure your member declaration does not use the new keyword unless it is a class object or array declaration.

The following example illustrates this error:

public class Simple {
   
   public void method1() {
      String myString = new String(); /*usage OK since it is a class
                                        object*/
      int x[] = new int[10]; //usage of new here is OK
      int i = new int(5); 
      // error: cannot use 'new' on 'int' types
   }
}