静态导入 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
		 */
	}
	
}

相关文章:

  • 2021-08-18
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2021-08-15
  • 2021-07-08
  • 2021-08-15
猜你喜欢
  • 2022-12-23
  • 2022-01-21
  • 2021-08-20
  • 2021-11-07
  • 2021-06-04
  • 2021-11-04
  • 2022-03-09
相关资源
相似解决方案