diff --git a/LambdaExample.java b/LambdaExample.java index 5355ae5..6f235f0 100644 --- a/LambdaExample.java +++ b/LambdaExample.java @@ -9,13 +9,18 @@ //} +Interface Shape { + void draw(); +} + + public class LambdaExample { public static void main(String[] args){ Shape rectangle = () -> System.out.println("rectangle drawn"); print(rectangle); } - public static void print(Shape shape){ + public static void print(Shape: Shape shape){ shape.draw(); } }