import java.util.Arrays;

public class ArraysCopyOfDemo
{
  public static void main( String[] args )
  {
    String[] snow = { "Neuschnee", "Altschnee", "Harsch", "Firn" };
    
    String[] snow1 = Arrays.copyOf( snow, 2 );         // [Neuschnee, Altschnee]
    String[] snow2 = Arrays.copyOf( snow, 5 );         // [Neuschnee, Altschnee, Harsch, Firn, null]
    String[] snow3 = Arrays.copyOfRange( snow, 2, 4 ); // [Harsch, Firn]
    String[] snow4 = Arrays.copyOfRange( snow, 2, 5 ); // [Harsch, Firn, null]

    System.out.println( Arrays.toString( snow1 ) );
    System.out.println( Arrays.toString( snow2 ) );
    System.out.println( Arrays.toString( snow3 ) );
    System.out.println( Arrays.toString( snow4 ) );
  }
}
