package com.company;
/**
* @author huyuansong
* @date 2021/5/12
*/
@FunctionalInterface
interface Imath {
int add(int a, int b );
}
public class Demo24 {
public static void main(String[] args) {
//表達(dá)式里只有一行進(jìn)行數(shù)據(jù)的返回,那么直接使用語句即可,可以不適用return
? ? ? ? Imath shili1 = ( a, b )->{return a + b; };
? ? ? ? Imath shili = ( a, b ) -> ( a + b );
? ? ? ? System.out.println(shili.add(1, 2));
? ? }
}