Can lambda expressions be the alternative of polymorphism?
Clash Royale CLAN TAG #URR8PPP Can lambda expressions be the alternative of polymorphism? I am learning lambda expressions and functional interfaces. We can directly write an implementation of the interface by the lambda expression. So I think, it could be the alternative for polymorphism. I have some code using polymorphism, interface Drawable { public void draw(); } class Shape { protected String name; public Shape(String name) { this.name = name; } } class Rectangle extends Shape implements Drawable { public Rectangle(String name) { super(name); } @Override public void draw() { System.out.println("I am "+this.name); System.out.println("Drawing rectangle with 2 equal sides."); } } class Square extends Shape implements Drawable { public Square(String name) { super(name); } @Override public void draw() { System.out.println("I am "+this.name); System...