Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is an annotation?
Think about how they relate to classes and methods.
Name one built-in annotation in Java.
Consider annotations that modify method behavior.
What is a custom annotation in Java?
Think about how you can create your own annotations.
True or False: Annotations can affect the semantics of the program.
Consider what annotations actually do in your code.
Define a custom annotation @Version that can be applied to classes to indicate the version of the class. It should have a String attribute for the version number.
Think about where the annotation can be applied and how it should be structured.
Imagine you are developing a library management system. Create an annotation @Book that can be applied to methods that need to log book borrowing activity. Include fields for the user ID and book ID.
Consider method-level annotations and what information needs to be captured.
5 more questions in this section. Enroll free to practise them all.
Enroll free