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? 

import java.lang. annotation. *; @interface Bread { public int maker = 5;

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

1 Expert Approved Answer
Step: 1 Unlock

The image provided shows two Java interface declarations for annotations Bread and Toast Based on th... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!