extends class and implements interface in java

Ravi picture Ravi · Dec 24, 2012 · Viewed 81.6k times · Source
interface Bouncable{ } 
interface Colorable extends Bouncable{ } 
class Super implements Colorable{ } 
class Sub extends Super implements Colorable {} // Ok (case -1)

But,

class Sub implements Colorable extends Super {} // error (case -2)

Why case-2 showing compilation error { expected. Why ?? Although, case-1 executes without error.

Answer

yegor256 picture yegor256 · Dec 24, 2012

extends should go before implements:

class Sub extends Super implements Colorable {}