Discussion:
Making abstract class an interface
Ted Yu ted_yu-/E1597aS9LQAvxtiuMwx3w@public.gmane.org [seajug]
2014-05-17 16:19:23 UTC
Permalink
Hi,
There're currently two classes, A and B, which are both abstract and B extends A.
A has this method:

  public void setReversed(boolean reversed) {
    this.reversed = reversed;
  }
If I make A an interface and move the above method to B, what would happen to client code which was compiled against old API (extending B, not A) but is executed against jar built with new API ?

Thanks
dev danke devdanke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [seajug]
2014-05-17 21:25:39 UTC
Permalink
You should be able to test this very easily yourself.
Post by Ted Yu ted_yu-/***@public.gmane.org [seajug]
Hi,
There're currently two classes, A and B, which are both abstract and B extends A.
public void setReversed(boolean reversed) {
this.reversed = reversed;
}
If I make A an interface and move the above method to B, what would happen
to client code which was compiled against old API (extending B, not A) but
is executed against jar built with new API ?
Thanks
Loading...