cdm/src/main/java/ucar/nc2/Variable.java
public int[] getShape() {
    int[] result = new int[shape.length];  // optimization over clone()
    System.arraycopy(shape, 0, result, 0, shape.length);
    return result;
  }
public int[] getShape() {
    int[] result = new int[shape.length];  // optimization over clone()
    System.arraycopy(shape, 0, result, 0, shape.length);
    return result;
  }
public int [ ] getShape ( ) { int [ ] result = new int [ shape . length ] ; // optimization over clone() System . arraycopy ( shape , 0 , result , 0 , shape . length ) ; return result ; }
Get the shape: length of Variable in each dimension.
A scalar (rank 0) will have an int[0] shape.

@return int array whose length is the rank of this Variable
and whose values equal the length of that Dimension.
Get the shape : length of Variable in each dimension . A scalar ( rank 0 ) will have an int [ 0 ] shape .