Skip to main content

Posts

Showing posts with the label Java

Java 8:What are Lambda Expressions ?

Java is an object oriented programming language.  Everything in Java language is an Object. A variable or method or a block of code can not exist of it own. A class is building block , a fundamental structure from which we create and use an object. All methods and variables are tied to a class. A class must be instantiate so that you can invoke methods appropriately. Even if a single line of business logic, it must be written in a method, declared in a class, instantiate a class and invoke the method on that object.In pre Java 8 we can't have free floating code of expression.Also mutability is inherent in java language, java does not put restriction on mutability,  it is upto developer responsibility to create immutable methods. What are Lambda Expressions? Lambda expressions are a new and important feature included in Java SE 8.Lambda Expressions are blocks of code that represents behaviour which can be passed around to other methods. This pieces allows us to functional p...