1

i want to know if there'a way to declare that an interface extends another interface with three different generics type parameters

interface AggDBTree: DBTreeInterface<T, X, V>{
 //method declarations
}
1
  • Have you actually tried to do that? Commented Sep 11, 2019 at 9:48

1 Answer 1

2

If you want that superinterface to have three different generic parameters, you can do that:

interface DBTreeInterface<A, B, C>

interface AggDBTree<T, X, V> : DBTreeInterface<T, X, V>

If you want to implement the same interface, but with various type parameters, that is not possible. So something like this will not compile:

interface DBTreeInterface<T>

interface AggDBTree<A, B> : DBTreeInterface<A>, DBTreeInterface<B>

You can only extend a single interface once.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.