nerdexam
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

1Z0-803 question #66 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)
  • B
    92% (35)
  • D
    3% (1)
  • E
    5% (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.

Full 1Z0-803 Practice