20160722

Array Copy Of Range

class ArrayCopyOfRangeExample {
   
  public static void main(String[] args) {
 
    char[] copyFrom = { 'd', 'e', 'c', 'a', 'f', 'f', 'e', 'i', 'n', 'a',
        't', 'e', 'd' };
 
    char[] copyTo = java.util.Arrays.copyOfRange(copyFrom, 2, 9);
 
    System.out.println(new String(copyTo));
  }
}

OUTPUT

caffein

Disqus Shortname

Recent Post Number

Related Post Number

Comments system