class AlgorithmsDemo {
public static void main(String args[]) {
List<Integer> ll = new LinkedList<Integer>();
ll.add( 1 );
ll.add( 2 );
ll.add( 3 );
Integer findValue= 2 ;
if (ll.contains(findValue)) {
System.out.println( "existed: " + findValue);
}else {
System.out.println( "not existed: " + findValue);
}
}
}
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/15798.html