This is a functional interface
4. whose functional method is {@link #test(Object)}.
5. 6. @param 允许在接口内声明静态方法指定接口方法的默认实现 自我推荐 Any exceptions thrown during evaluation of either predicate are relayed
* to the caller; if evaluation of this predicate throws an exception, the
* {@code other} predicate will not be evaluated.
*
* @param other a predicate that will be logically-ANDed with this
* predicate
* @return a composed predicate that represents the short-circuiting logical
* AND of this predicate and the {@code other} predicate
* @throws NullPointerException if other is null
*/
default Predicate 代码演示 定义:申明方法的同时提供实现 Any exceptions thrown during evaluation of either predicate are relayed
* to the caller; if evaluation of this predicate throws an exception, the
* {@code other} predicate will not be evaluated.
*
* @param other a predicate that will be logically-ORed with this
* predicate
* @return a composed predicate that represents the short-circuiting logical
* OR of this predicate and the {@code other} predicate
* @throws NullPointerException if other is null
*/
default Predicate 冲突解决 文章为作者独立观点,不代表股票交易接口观点/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package java.util.function;
import java.util.Objects;
/**
1. Represents a predicate (boolean-valued function) of one argument.
2. 3.
public interface A {
//默认接口实现
default void hello(){
System.out.println('Hello World');
}
//静态方法
static void say(){
System.out.println('Hello World');
}
}