Oracle
1Z0-803 · Question #66
Given: Why will the code not compile?
The correct answer is B. The getLetter method has no body.. The getLetter() method needs a body public static int getLetter() { }; .
Working with Methods and Encapsulation
Question
Given:
Why will the code not compile?
Exhibit
Options
- AA static field cannot be private.
- BThe getLetter method has no body.
- CThere is no setletter method.
- DThe letter field is uninitialized.
- EIt contains a method named Main instead of ma
How the community answered
(38 responses)- B92% (35)
- D3% (1)
- E5% (2)
Explanation
The getLetter() method needs a body public static int getLetter() { }; .
Topics
#compilation error#method definition#static methods
Community Discussion
No community discussion yet for this question.
