lamba

时间:2023-02-14 10:56:47


lamba

lamba

/**
* lamba
*/
@Test
public void test5() {
Runnable r = () -> System.out.println("hello");
r.run();
}


@Test
public void test6() {
int num = 0;
Runnable r = new Runnable() {
@Override
public void run() {
System.out.println("java");

}
};
r.run();
}