Lambda expression

 interface Drawable {

void draw();

}

public class LambdaDemo {

 public static void main(String[] args) {

 Drawable d = () -> System.out.println("Drawing with Lambda");

 d.draw();

 }

}

// Output:

// Drawing with Lambda

Comments

Popular posts from this blog

10. Vehicle and Car

Interface with Rectangle

Multiple interface