The correct answer is C. By defining the fields in an interface, you can make sure that the client code cannot modify them. In an interface, all fields are implicitly public, static, and final, so their values cannot be changed once they are initialized.
C In Java, interface variables are implicitly considered as constants and are therefore effectively final. By default, all variables declared in an interface are implicitly marked as public, static, and final, regardless of whether the public, static, or final modifiers are explicitly specified.
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
TheOneAboveAll
3 months agoStavok
5 months, 3 weeks agoKiraguJohn
6 months, 1 week ago