Possible Duplicate:
What are the similarities and differences between Java Annotations and C# Attributes?
Currently we are translating an Java project into C#, but we're having problems finding out what the C# equivalent is for Java annotation. How do we write the exact same thing as this java code into C#?:
public @interface LatitudeAnnotation {
public String author() default "Themaopdracht 7 tester";
}
Annotation is defined like a ordinary Java interface, but with an '@' preceding the interface keyword (i.e., @interface ). You can declare methods inside an annotation definition (just like declaring abstract method inside an interface). These methods are called elements instead.
Annotation Types Used by the Java Language @Deprecated @Deprecated annotation indicates that the marked element is deprecated and should no longer be used. The compiler generates a warning whenever a program uses a method, class, or field with the @Deprecated annotation.
Java annotations are metadata (data about data) for our program source code. They provide additional information about the program to the compiler but are not part of the program itself. These annotations do not affect the execution of the compiled program.
The C++ Annotations are also available as a Kindle book. Don't hesitate to send in feedback: send an e-mail if you like the C++ Annotations; if you think that important material was omitted; if you find errors or typos in the text or the code examples; or if you just feel like e-mailing. Send your e-mail to Frank B.
Attributes are to C# what annotations are to Java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With