Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- String[] customerProducts = new String[5];
- Scanner scn = new Scanner(System.in);
- for (int i = 0; i<5; i++){
- customerProducts[i] = scn.nextLine();
- }
- foundProduct(customerProducts);
- }
- private static void foundProduct(String[] customerProducts){
- List products = Arrays.asList(new String[]{"black","white"});
- for (int i = 0; i < customerProducts.length; i++) {
- if (products.contains(customerProducts[i])) {
- System.out.println("found " + customerProducts[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement