package com
.baosen
.learnlambda
;
interface IMessage{
void send(String content
);
}
public class FirstLambda {
public static void main(String
[] args
) {
IMessage msg
= (content
-> {
System
.out
.println("content = " + content
);
});
msg
.send("HelloWorld!");
IMessage msg1
= (content
)->{
System
.out
.println("content = " + content
);
};
msg1
.send("Hello Java!");
IMessage msg2
= (content
)-> System
.out
.println("content = " + content
);
msg2
.send("Hello Lambda!");
}
}
转载请注明原文地址:https://tech.qufami.com/read-19261.html