Skills101
← All practice quizzes

Quiz: Abstract Classes and Interfaces

5 questionsNo time limitPass: 60%+10 XP on first pass

Abstraction hides "how" and shows "what". Learn abstract classes and methods, interfaces with default and static methods, multiple interfaces, and how to choose.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    Can you create an object of an abstract class with new?

  2. Question 2

    How many interfaces can a class implement?

  3. Question 3

    Fields declared in an interface are automatically:

  4. Question 4

    What does this print?

    interface Greeter { default String hi() { return "hi"; } }
    class Friend implements Greeter { }
    public class Main {
        public static void main(String[] args) {
            System.out.println(new Friend().hi());
        }
    }
    
  5. Question 5

    Which is a functional interface?