I'm aware that arrays are objects and in java objects are transfered by reference which could cause aliasing so objects should be returned with in this form to not cause aliasing:
return new (object(parameters));
So this is what I'm trying to do with multidimensional arrays, however for some reason compiler says I have an error : "array dimension missing".
public int Testing(intarr)
return new intnewArr;
Since you are creating your array inside your method, there is no risk for aliasing in this scenario. Noone else can get a reference to your array.
will work just fine.