public void add(int a, int b){
System.out.println(a+b);
}
//lambda expressions
(int a, int b) -> System.out.println(a+b);
(a, b) -> System.out.println(a+b);
Example 03
public int square(int n){
return n*n;
}
//lambda expressions
(int n) -> {return n*n;}
(n) -> {return n*n;}
n -> n*n;
Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!
Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.
Top comments (0)