without lambda expression

Home   »   without lambda expression

interface Table{  
    public void draw();  
}  
public class Demo {  
    public static void main(String[] args) {  
        int length=10;  
  
        //without lambda, Drawable implementation using anonymous class  
        Table t=new Table(){  
            public void draw(){System.out.println("Drawing "+length);}  
        };  
        t.draw();  
    }  
}  

Leave a Reply

Your email address will not be published. Required fields are marked *