Java is to JavaScript what car is to Carpet – Chris Heilmann Hello to all the java enthusiast out there! Today I will talk about lambda's in java and about colon operators. So What exactly is a lambda? Simply put, it is a function without any name, any return type or any modifier. Let us understand with a simple example public void divide(int a , int b) { System.out.println(a/b); } The above code has the following attributes : Name : divide Modifier : public There is no return type here. For lambda, we will remove these first as - (int a , int b) { System.out.println(a/b); } If you have some knowledge about lambda's, you might think - Hey ! Where are those arrow things? We add them after the parameters : (int a , int b) -> { ...
Just something to talk about