Question: Fill in the blank with the correct value for @Target that allows the code to compile. A. ElementType.METHOD, ElementType.CONSTRUCTOR B. ElementType.ANNOTATION_TYPE C. ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.METHOD

Fill in the blank with the correct value for @Target that allows the code to compile. 

import java.lang.annotation.*; @Target ({_ _}) public @interface Light Source {} } Light

A. ElementType.METHOD, ElementType.CONSTRUCTOR

B. ElementType.ANNOTATION_TYPE

C. ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.METHOD

D. ElementType.TYPE_USE

E. ElementType.LOCAL_VARIABLE, ElementType.FIELD

F. None of the above.

import java.lang.annotation.*; @Target ({_ _}) public @interface Light Source {} } Light Source class Bulb { @LightSource void light Switch() {} @LightSource private Bulb () {}

Step by Step Solution

3.39 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

C ElementTypeCONSTRUCTOR ElementTypeTYPE ElementTypeMETHOD The Target annot... 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!