Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.function.Predicate;

public class Main {

    public static void main(String[] args) {
        Predicate<String> a = (input) -> input.contains("a");
        Predicate<String> b = (input) -> input.contains("b");

        System.out.println("test ac:" + a.or(b).test("ac"));
        System.out.println("test bc:" + a.or(b).test("bc"));
        System.out.println("test de:" + a.or(b).test("de"));

    }

}