Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Annotation C# equivalent [duplicate]

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";
}
like image 804
Mittchel Avatar asked May 04 '12 20:05

Mittchel


People also ask

What is @interface annotation in Java?

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.

What is @deprecated annotation in Java?

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.

What is Java annotation code?

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.

Are there annotations in C++?

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.


1 Answers

Attributes are to C# what annotations are to Java

like image 177
DarthVader Avatar answered Oct 04 '22 03:10

DarthVader