你认为有可能创造类似的东西吗?
private ArrayList increaseSizeArray(ArrayList array_test, GenericClass) {
array_test.add(new GenericObject()); // instance of GenericClass
return array_test;
}
Run Code Online (Sandbox Code Playgroud) 我们有n个变量,X = {x1,x2,...xn}它们不属于任何结构.
以python为例,我可以这样做: if (x1 == x2 == x3 == xn):
在java中我必须这样做: if((x1 == x2) && (x2 == x3) && (x3 == xn)):
您是否知道改进此语法的简单方法?(想象一下很长的变量名称和很多)
谢谢.