different ways of declaring an array in java code example Example: Declare, instantiate, initialize and use a one-dimensional array data = new Double[10];