使用随机和超级
2022-09-03 13:31:29
如何将 a 从 调用到 ?Randomjava.util.Randomsupertype constructor
例如
Random rand = new Random();
int randomValue = rand.nextInt(10) + 5;
public Something()
{
super(randomValue);
//Other Things
}
当我尝试这样做时,编译器说我“在被调用之前无法引用”。randomValuesupertype constructor