/*
*来 自
n o w j a v a . c o m
*/
//package com.nowjava;
import java.util.List;
public class Main {
public static void main(String[] argv) throws Exception {
List list = java.util.Arrays.asList("asdf", "nowjava.com");
Object o = "nowjava.com";
System.out.println(moveDown(list, o));
}
@SuppressWarnings("unchecked")
public static boolean moveDown(List list, Object o) {
int index = list.indexOf(o);
if (index >= 0) {
try {/** 时代Java - N o w J a v a . c o m 提 供 **/
Object temp = list.set(index + 1, o);
list.set(index, temp);
return true;
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。