Thanks a lot! , the first two examples were really clear and I completely understood the usage!
I think C# has these features and people who have a C# background would have a jumpstart on these , but In java there were no such thing , but its a very great addition