Dayrvia
Jv

Java · Interfaces · Practice questions

Try 1 question on Java · Interfaces, then read the explanations and review the related concepts.

Practice questions

Choose an answer and move to the next question. Grade the last one to see explanations and review links.

1 question
Q1 What does c.total(6) return?
interface Cost { int total(int n); }
class Pair implements Cost {
    public int total(int n) { return 2 * n; }
}
// inside main
Cost c = new Pair();
Original practice questions written for Dayrvia.