Java Abstract Class declares throwable - implementation does not enforce it?
<p>I was wondering about the difference between using an abstract class and interface and this puzzled me a bit:</p>

<p>Suppose you have an abstract class</p>

<pre><code>public abstract class Animal {   
//return the tail lenght of the animal
public abstract int getTailLength() throws IllegalStateException;
}
</code></pre>

<p>that promises that implementations of the abstract class have a method called getTailLength() [compiler forces extended classes to @override the abstract class and implement them] like so:</p>

<pre><code>public Snake extends Animal(){

@override
public int getTailLength(){
  return 10;
}
}
</code></pre>

<p>The compiler is fine with this yet in the abstract class when we declare to want an implementation of getTailLenght() we also mention that we want it to throw an exception - yet in the above snippet that has been omitted.</p>

<p>Am I right in thinking that this is not allowed when doing the same with an Interface and 'implements' declaration?</p>

<p>I suppose that because you annotate the method with @override the compiler simply doesn't care what you do as long as you have a method that has the name you enforce in the ADT? It does check for the return type, why does it not enforce the exception?</p>