Code Fix

上級is not abstract and does not override の原因と直し方 › パターン1

is not abstract and does not override の原因と直し方

抽象メソッドの実装漏れ。

 1  abstract class Shape {
 2      abstract double area();
 3  }
 4  public class Main extends Shape {
 5      _____________________________
                      ^
 6      public static void main(String[] args) {
 7          System.out.println(new Main().area());
 8      }
 9  }
Main.java:4: error: Main is not abstract and does not override abstract method area() in Shape

空欄を埋めてビルドを通す

広告
広告スロット(未設定)

is not abstract and does not override の原因と直し方

extendsとimplementsの使い分け、可視性の制約も扱います。

このエラーの解説と類題をまとめて見る →

広告
広告スロット(未設定)