Multiple choice technology programming languages

Which of the following is correct syntax for an Abstract class ?

  1. abstract double area() { }

  2. abstract double area()

  3. abstract double area();

  4. abstract double area(); { }

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

An abstract method in Java is declared with the abstract keyword and has no method body (just a semicolon). Option C shows correct syntax. Option A has a body (not abstract), B is incomplete, D has invalid syntax.