nerdexam
Oracle

1Z0-803 · Question #5

Which code fragment is illegal?

The correct answer is D. Option D. The abstract keyword cannot be used to declare an int variable. The abstract keyword is used to declare a class or method to beabstract[3]. An abstract method has no implementation; all classes containing abstract methods must themselves be abstract, although not all abstract cla

Java Basics

Question

Which code fragment is illegal?

Exhibit

1Z0-803 question #5 exhibit

Options

  • AOption A
  • BOption B
  • COption C
  • DOption D

How the community answered

(41 responses)
  • B
    2% (1)
  • C
    2% (1)
  • D
    95% (39)

Explanation

The abstract keyword cannot be used to declare an int variable. The abstract keyword is used to declare a class or method to beabstract[3]. An abstract method has no implementation; all classes containing abstract methods must themselves be abstract, although not all abstract classes have abstract methods.

Topics

#java syntax#compilation errors#legal code constructs

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice