This example show you how to use the HelloAnnotation
annotation on the previous example code, How do I create a simple annotation?. We add the HelloAnnotation
annotation to our class and its methods.
package org.kodejava.lang.annotation;
@HelloAnnotation(value = "Good Morning", greetTo = "Universe")
public class HelloAnnotationExample {
public static void main(String[] args) {
HelloAnnotationExample hello = new HelloAnnotationExample();
hello.sayHi();
hello.sayHello();
}
@HelloAnnotation(value = "Hi there", greetTo = "Alice")
private void sayHi() {
}
@HelloAnnotation(value = "Hello there", greetTo = "Bob")
private void sayHello() {
}
}
Latest posts by Wayan (see all)
- How do I create a table with multiple header in iText 8? - March 16, 2024
- How do I add Image to a Table in iText 8? - March 11, 2024
- How do I downgrade Android SDK emulator version? - February 12, 2024