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
Options
- AOption A
- BOption B
- COption C
- DOption D
How the community answered
(41 responses)- B2% (1)
- C2% (1)
- D95% (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.
