我正在寻找一种方法来允许这个类的构造函数接受泛型类型的数组.
public class my
{
public my(T[] arr) // how resolve this
{
...
}
}
Run Code Online (Sandbox Code Playgroud) 怎么解决这个
如何改变代码以获得相同的结果
public class myClass
{
List<Drawable> d;
List<Bitmap> b;
public myClass(Integer[] resIDsList)
{
...
}
public myClass(List<? extends Drawable> drawableList) // error occure here
{
d = drawableList;
}
public myClass(List<? extends Bitmap> bitmapList) // and here too
{
b = bitmapList;
}
}
Run Code Online (Sandbox Code Playgroud)
如果构造函数在上面相同?
我的声明(thread.setDaemon(true)表示在主线程中断时中断线程)是否为真?
setDaemon(true)是什么意思?