Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {

    public static String[] changeArray(String[] src, int index) {
        String[] dest = new String[src.length - 1];
        System.arraycopy(src, 0, dest, 0, index);
        System.arraycopy(src, index + 1, dest, index, dest.length - index);
        return dest;
    }

    public static String[] changeArray(String[] src, int fromIndex, int toIndex) {
        String[] dest = new String[src.length - (toIndex - fromIndex + 1)];
        System.arraycopy(src, 0, dest, 0, fromIndex);
        System.arraycopy(src, toIndex + 1, dest, fromIndex, dest.length - fromIndex);
        return dest;
    }
}