Квиз по Java: Abstract Classes & Interfaces

This Java quiz checks how abstract classes and interfaces define contracts for other classes. You will predict output with abstract methods, default methods and lambdas, and spot the rules the compiler enforces when you implement them.

Средний 10 вопроса ~6 минуты Проходной балл: 80% Java 17

Выберите режим

Вы играете как гость: войдите, чтобы сохранить XP и серию.

Пример вопроса

Вопрос 1 из 10

What happens when you compile and run this?

public class Main {
    static abstract class Shape {
        abstract double area();
    }

    public static void main(String[] args) {
        Shape s = new Shape();
        System.out.println(s.area());
    }
}
Показать ответ

A. Compile error An abstract class cannot be instantiated with new, because some of its methods have no body. You create a concrete subclass, or an anonymous class, instead.

Что проверяет этот квиз

  • Abstract classes and abstract methods
  • Interfaces, default methods and constants
  • Implementing interfaces with public methods
  • Functional interfaces and lambdas
  • Choosing between an abstract class and an interface

Частые вопросы

Нужен ли аккаунт?

Нет. Играть может любой. Войдите, чтобы сохранять XP, серию, значки и историю.

Можно пройти ещё раз?

Да. Лучший результат сохраняется, а вопросы и ответы каждый раз перемешиваются.