Microsoft SDK for Java

J0181-J0200

J0181 J0182 J0183
J0184 J0185 J0186
J0187 J0188 J0189
J0190 J0191 J0192
J0193 J0194 J0195
J0196 J0197 J0198
J0199 J0200  

J0181 - Not used

This error message is currently not used.

J0182 - Not used

This error message is currently not used.

J0183 - Not used

This error message is currently not used.

J0184 - Not used

This error message is currently not used.

J0185 - Not used

This error message is currently not used.

J0186 - Not used

This error message is currently not used.

J0187 - Not used

This error message is currently not used.

J0188 - Not used

This error message is currently not used.

J0189 - 'return' not allowed in a static initializer or instance initializer

A return statement was found in a static initializer. Initializers, like constructors, cannot return a value. Remove the return statement, and then compile again.

The following sample illustrates this error.

public class Simple{
   
   static int var1;
   
   static{
   
   var1 = 0;
   return; // Error, static initializer cannot use the
           // return statement.
   
   }
}

J0190 - Not used

This error message is currently not used.

J0191 - Expected '.class'

The compiler detected usage of an intrinsic type name in an assignment statement but did not find .class after the name. This error most often occurs when the .class keyword was omitted. Make the appropriate changes to the statement, and then compile again.

The following sample illustrates this error.

public class Simple{
   public static void main (String args[]){
      Class x = int;//error: missing '.class'
   }
}

J0192 - '.class' on intrinsic type requires Java 1.1 compatible class libraries

The compiler has detected usage of .class with an intrinsic data type, but either the Microsoft virtual machine or the Java class libraries are based on Java 1.0. Make sure that your class libraries and Microsoft VM are the Java 1.1 versions, and then compile again.

J0193 - Cannot have an array of type 'void'

An attempt to define an array of type void was found by the compiler. The void data type is for use with methods to declare the method has no return value and thus cannot be used as an array.

J0194 - class or interface cannot be declared 'volatile', 'native', 'transient', or 'synchronized'

The compiler detected that an inner class has been declared with one of the above mentioned modifiers. Inner classes can only use the private, public, protected, and static modifiers.

The following example illustrates this error.

public class Simple{
   //Do something here
   volatile class InnerClass{
      /*error: like outer class, inner classes cannot be defined as
               volatile */
   }
}

J0195 - Cannot declare 'identifier' as 'static' in inner class 'identifier'

The compiler detected an attempt to declare a variable or method as static from within an inner class. Unlike regular class declarations, inner classes do not support static members unless the inner class has been declared static. This error can also occur if an interface was defined within an inner class.

The following example illustrates this error.

public class Simple{
   
   //Do something meaningful here
   
   class InnerClass{
   
   static int var1; /* error: cannot declare static
                              members in inner class */
   }
}

J0196 - Nested class 'identifier' cannot have the same name as any of its enclosing classes

The specified inner class has the same name as one of the classes that it is nested under. Make sure you have not duplicated the name of a class that your inner class is nested in.

The following example illustrates this error.

public class Simple{
   
   // Do something meaningful here
   class InnerClass{
      //Do something meaningful here
        class Simple{
            //error: inner class has same name as a parent class
        }
   }
}

J0197 - Cannot declare interface in inner class 'identifier'.

The compiler detected an attempt to declare an interface inside an inner class. Inner class definitions do not support interfaces declared within them.

The following example illustrates this error.

public class Simple{
   //Do something meaningful here
   class InnerClass{
   //Do something meaningful here
      interface MyInterface{
         /*error: interfaces cannot be declared
                  inside inner classes */
      }
   }
}

J0198 - An enclosing instance of type 'identifier' is required

The compiler detected that an inner class definition has tried to reference something outside of its scope. Examples of when this can occur are:

The following example illustrates this error.

//This example illustrates the first error situation
public class Simple{
   int x = 10;
   static class InnerClass{
      public void method1(){
         int y = x; /*error: instance variable needed
                             to reference parent
                             variables. */
      }
   }
}
//This example illustrates the second error situation
class A{
   int x;
}
class B{
   //Do something meaningful here
   class InnerClass{
      void method1(){
         int y = A.this.x;
         /*error: no instance of A defined. Cannot use
           the <classname.this.variable> syntax here.*/
      }
   }
}

J0199 - Call of 'this()' cannot be qualified

The compiler detected that an inner class's constructor attempted to call a constructor from its outer class using the class name and this(). Inner classes cannot call their outer class's constructors.

The following example illustrates this error.

public class Simple{
   int x;
   Simple(int x){
      this.x = x;
   }
   class InnerClass{
      InnerClass(){
         Simple.this(10);
         //error: cannot call outer class constructor
      }
   }
}

J0200 - 'this' must be qualified with a class name

The compiler detected that an attempt was made in an inner class to reference an outer class member using the this keyword with a name other than an outer class's name. Only the name of the outer class can be used from an inner class to reference members of the outer class.

The following example illustrates this error.

public class Simple{
   int x;
   class InnerClass{
      void method1(){
         int j = x.this;
         /*error: only a class name can be used with
         this to reference outer class */
      }
   }
}

© 1999 Microsoft Corporation. All rights reserved. Terms of use.