QUESTION 2 Fruit is an enumerated type with values apple, banana, grape, and orange, in that order. Which of the following statements assigns the value orange to the Fruit variable snack? a. snack = Fruit.orange; b. Fruit.snack = orange; c. snack = orange; d. snack = Fruit(4);

Respuesta :

Limosa

Answer:

Option A i.e., snack = Fruit.orange;

Explanation:

It is the user-defined data type which is mainly used to initialize the names or titles to integral constants so in the following statement 'Fruit' is the enumerate data type function and its values are the followings given in the statement, 'snack' is the variable of the function 'fruit' that is an enum type, so the initialization is done by the following type in the Java Programming Language.