التخطي إلى المحتوى الرئيسي

المشاركات

عرض الرسائل ذات التصنيف Corporate Java

Lambda Expression In Java, What is forEach() in java

 Lambda Expression In Java:- .................................................................................................................................................................. What is a lambda expression? It is a new feature of Java 8 that is used to define the method in a concise pattern. Lambda function uses an anonymous method to block to define functionality. if we want to implement the features under the method of interface or abstract class then we can use a lambda expression. Syntax of a lambda expression? ()->{ Expression } 1) Example of Lambda Expression without return type method package com.scs; interface A {     public void fun(); } interface B {     public  int fun1(); } public class LamdaExpression {     public static void main(String[] args) {         A obj = () -> {                 System.out.println("Lambda Expression A");        ...