Source Code : Doubles the size of an array
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Doubles the size of an array
//package com.ryanm.droid.rugl.util;
/**
* @author ryanm
*/
public class ArrayUtil
{
/**
* Doubles the size of an array
*
* @param in
* @return The new array
*/
public static String[] grow( String[] in )
{
String[] na = new String[ in.length * 2 ];
System.arraycopy( in, 0, na, 0, in.length );
return na;
}
/**
* Doubles the size of an array
*
* @param in
* @return The new array
*/
public static long[] grow( long[] in )
{
long[] na = new long[ in.length * 2 ];
System.arraycopy( in, 0, na, 0, in.length );
return na;
}
/**
* Doubles the size of an array
*
* @param in
* @return The new array
*/
public static int[] grow( int[] in )
{
int[] na = new int[ in.length * 2 ];
System.arraycopy( in, 0, na, 0, in.length );
return na;
}
}
Thank with us