Question discussion

Given the following piece of code:public class School{ public abstract double numberOfStudent();}which of the following statements is true?

281217Medium 1 reply 598 views
0
Given the following piece of code:public class School{ public abstract double numberOfStudent();}which of the following statements is true?
  • AThe keywords public and abstract cannot be used together.
  • BThe method numberOfStudent() in class School must have a body.
  • CYou must add a return statement in method numberOfStudent().
  • DClass School must be defined abstract.
Correct answer: D

Discussion 1

0
CCommunity
Class School must be defined abstract.