Search Interview Questions
| 3356 questions in repository.|
There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Java - Interview Questions and Answers|
|Ans. @Retention annotation specifies how the marked annotation is stored:|
@Documented annotation indicates that whenever the specified annotation is used those elements should be documented using the Javadoc tool. (By default, annotations are not included in Javadoc.)
@Target annotation marks another annotation to restrict what kind of Java elements the annotation can be applied to.
@Inherited annotation indicates that the annotation type can be inherited from the super class. (This is not true by default.) When the user queries the annotation type and the class has no annotation for this type, the class' superclass is queried for the annotation type. This annotation applies only to class declarations.
@Repeatable annotation, introduced in Java SE 8, indicates that the marked annotation can be applied more than once to the same declaration or type use. For more information, see Repeating Annotations.
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  java   java8   annotations   meta annotations|
|What are concepts introduced with Java 5 ?|
|Which annotations are used in Hibernate ?|
|Give an Example of Annotations ?|
|What are meta Annotations ?|
|How to create a Junit to make sure that the tested method throws an exception ?|
|What is the use of @GeneratedValue annotation in Hibernate?|
|Explain Annotations ?|
|What are few of the Annotations pre defined by Java?|
|What entries we make in the hibernate config file if we are not using hbm files but Annotations ?|