Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个通用的抽象类Plot<T>。如何定义一个可以接受任何抽象类实现的集合?我尝试了以下方法但没有成功:
Plot<T>
public List<Plot<object>> Plots = new List<Plot<object>>();
public List<Plot<dynamic>> Plots = new List<Plot<dynamic>>();
谢谢。
像这样的情况通常需要创建一个非泛型基类,泛型类从该基类派生:
public abstract class Plot { // Put anything which doesn't need T here } public class Plot<T> : Plot { }
然后你可以创建一个List<Plot>.
List<Plot>
I have a problem in JAVA when i'm trying to return a HashMap that I have added to a list of type: List<Object>. I know I can use other type of lists, but I need to use List<Object&g
List<Object>
List<Object&g
2 windows-phone-7 - 在 Windows Phone 的后台工作人员中使用计时器
2 java - 查找用户给定日期之间的星期三
1 c++ - 修改用于构建 boost 的默认编译器路径
1 primefaces - 通过拖出从 p:dashboard 中删除小部件
Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641