Compiler Error J0036

A data member cannot be 'native', 'abstract', or 'synchronized'

The compiler detected one of the modifiers shown above used in the declaration of a variable. The modifiers synchronized and native can only be applied to method declarations. The abstract modifier can be applied to methods, classes, and interfaces.

The following example illustrates this error:

public class Simple{
   
   native int myvar1;
   abstract int myvar2;
   synchronized int myvar3;
   //error: the vars above have invalid modifiers
   
}