Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

default methods vs abstract class

Hi,

I was reading below link

http://www.java2blog.com/2014/06/interface-default-methods-in-java-8.html

I have not understood below point relating to state

Parameter
Abstract class
Interface with default methods
State of objects
Abstract class can hold state of object
Interface with default methods can not hold state of objects

Read more at http://www.java2blog.com/2014/06/interface-default-methods-in-java-8.html#vEL23vv16DICqYjs.99

what is state of object?
How it one can hold and other cannot hold?

Also what it mean by overriding method to solve compilation error as below
you can solve this compilation error by overriding decorateWithPaints method in Room class
view plainprint?
public class Room implements Decorable,Paintable{  
 
    public void decorateWithPaints()  
    {        
        System.out.println("Decorate using paints");    
  }  
}

Read more at http://www.java2blog.com/2014/06/interface-default-methods-in-java-8.html#4dayfCwCZs3KPu77.99

please advise
ASKER CERTIFIED SOLUTION
Avatar of CPColin
CPColin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial