Examveda
Examveda

Given the following piece of code:
public class School{
        public abstract double numberOfStudent();
}

which of the following statements is true?

A. The keywords public and abstract cannot be used together.

B. The method numberOfStudent() in class School must have a body.

C. You must add a return statement in method numberOfStudent().

D. Class School must be defined abstract.

Answer: Option D


This Question Belongs to Java Program >> Interfaces And Abstract Classes

Join The Discussion

Comments ( 1 )

  1. Sandy Negi
    Sandy Negi :
    7 years ago

    in a class if any of the method is abstract then that class should be declared abstract

Related Questions on Interfaces and Abstract Classes

What is an interface in Java?

A. A contract specifying a set of methods that a class must implement

B. A class that cannot be instantiated

C. A class that contains only static methods

D. A subclass of the Object class