Skip to content

Instantly share code, notes, and snippets.

@wukaihua119
Created July 18, 2019 02:56
Show Gist options
  • Save wukaihua119/36cf4617fe28954fd54b6cc31f26b154 to your computer and use it in GitHub Desktop.
Save wukaihua119/36cf4617fe28954fd54b6cc31f26b154 to your computer and use it in GitHub Desktop.
package Thirty;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
public class Main{
public static void main( String [] args ){
//ArrayList lists = new ArrayList( Arrays.asList( 12, 98, 32, 0, -1, 56, 0 ) );
List lists = Arrays.asList( 12, 98, 32, 0, -1, 56, 0 );
if( lists.contains( 0 ) && lists.contains( -1 ) )
System.out.println( "This array contains 0 and -1" );
else
System.out.println( "This array doesn't contains 0 and -1" );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment