Question: Given the following declarations, which annotation can be applied to a method declaration? A. @Toast(true) B. @Toast C. @Bread(null) D. @Toast(wheat=true) E. @Bread F. None
Given the following declarations, which annotation can be applied to a method declaration?

A. @Toast(true)
B. @Toast
C. @Bread("null")
D. @Toast(wheat=true)
E. @Bread
F. None of the above, as the annotation declarations do not compile.
import java.lang. annotation. *; @interface Bread { public int maker = 5; String baker(); } @Inherited @interface Toast { } boolean buttered () default true; int freshness () default Bread.maker; static boolean wheat = false;
Step by Step Solution
3.36 Rating (152 Votes )
There are 3 Steps involved in it
The image provided shows two Java interface declarations for annotations Bread and Toast Based on th... View full answer
Get step-by-step solutions from verified subject matter experts
