V
V
Vlad2015-05-12 03:39:26
Java
Vlad, 2015-05-12 03:39:26

Is there a java wildcards equivalent in csharp?

Java has such a thing as wildcards, which is an extension of generic types.
Example using <?>

public abstract class AAA<T extends BBB<?>> extends CCC<T>{}

How to display <?> in C#
public abstract class AAA<T> : CCC<T> where T : BBB<как?>{}

I will be grateful for the answer.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dordzhiev, 2015-05-12
@dordzhiev

Well, there are no wildcards in Sharpe. You can just explicitly specify the type in the generic.

public abstract class AAA<T,T1> : CCC<T> where T : BBB<T1>

E
Ext4, 2015-05-12
@Ext4

dynamic ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question