BUG: Cannot Override Abstract Class Member When You Convert Your Code to C# (821176)
The information in this article applies to:
- Microsoft Visual J++ 1.0
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSYou can use the Java Language Conversion Assistant (JLCA) to
convert a project that is written in the Java programming language or the Visual J++ programming language to the C# programming language. However,
when you convert Java code that has an abstract method that is defined in an
abstract class, and this method is overridden in a derived class, you may receive the following error message when you compile the C# code: Cannot change access modifiers when overriding 'internal'
inherited member CAUSEThis problem occurs because the JLCA adds an internal modifier
for the abstract method in the abstract class when JCLA converts the Java code.RESOLUTIONTo resolve this problem, edit the C# code that the JLCA generates. Replace
the internal modifier with a public modifier. The following is the modified code:
abstract class Bird
{
public abstract void Wings();
}
class Robin:Bird
{
public override void Wings()
{
System.Console.Out.WriteLine("Robin");
}
}
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 8/15/2005 |
---|
Keywords: | kbpending kbCodeGen kbJava kbbug KB821176 kbAudDeveloper kbAudITPRO |
---|
|