static 静态导包

静态导入 ArrayUtils 类的 INDEX_NOT_FOUND 属性和 add 方法

import static org.apache.commons.lang3.ArrayUtils.INDEX_NOT_FOUND;
import static org.apache.commons.lang3.ArrayUtils.add;
import org.junit.Test;


/**
 * @作者 王睿
 * @时间 2016-5-18 下午4:00:08
 *
 */
public class StaticTest {
	
	@Test
	public void testStatic(){
		System.out.println(INDEX_NOT_FOUND);
		int[] arr = new int[]{1,2,3,4,5,6};
		arr = add(arr, 7);
		for (int i : arr) {
			System.out.println(i);
		}
		/**
		 * 输出:
		 * -1
		 *	1
		 *	2
		 *	3
		 *	4
		 *	5
		 *	6
		 *	7
		 */
	}
	
}
posted @ 2016-05-18 16:11  Nihaorz  阅读(637)  评论(0编辑  收藏  举报