Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
annotations
:
Content language: English
Русский
What will be the result of compilation and execution of the following code? import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.reflect.*; @Retention(RetentionPolicy.RUNTIME) @interface Anno{ int value() default 5; } public class Test { @Anno(10) public static void test(int i) { } public static void main(String [] args) { Method m = new Test().getClass().getMethod("test"); Anno anno = m.getAnnotation(Anno.class); System.out.println(anno.value()); } }
annotations
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes