Partager via


Using Keywords as Identifiers 

Visual J# allows @keyword to be treated as an identifier to allow the consumption of identifiers in referenced assemblies that are keywords reserved by Visual J#.

Example

// vjc_identifier_1.cs
// compile with: /target:library
// C# program
public class MyClass1
{
   public static int synchronized = 0;   // valid in C#
}
// vjc_identifier_2.jsl
// compile with: /reference:vjc_identifier_1.dll
public class MyClass2
{
    public static void main(String [] args)
    {
        MyClass1 x = new MyClass1();
        // System.Console.WriteLine(x.synchronized);   // error
        System.Console.WriteLine(x.@synchronized);   // OK
    }
}

Output

0

See Also

Reference

Syntax for Targeting the .NET Framework
Language Extensions to Support the .NET Framework