Suppose a Super Class method throws an exception and this method is Overriden in the subclass with no exception. Now if you create a super class reference that has a subclass object. This throws a compile time error, Why?
The answer to this question is pretty obvious that you need to supply the mean or the way to handle the exception either by declaring in the method itself or you should supply the catch statement or handle it in the caller method or the class that is calling the super class method and when you compile it again it would go fine.
Sub class's method will compile successfully as subclass's method can either specify the exception or not in its signature.But if its specifying it should be that exception any of the sub classes of exception or any runtime exception. Sub class method can 't add any new exception
While compiling such a program a base class reference always check for the compatibility for the base class method which is overridden in derived class as in future it may contain base class object for which methods calling should be verified for error checking.
Just now consider the method in super class do not throw any exception If we are assigning the object of subclass to super class reference and if we invoke the method using that reference the compiler will check whether that method is available in the super class since we are invoking the method only using the super class reference and if it is there then the prog successfully compiles but during execution JVM runs only the sub class version of the method. this is polymorphism.
The answer to this question is pretty obvious that you need to supply the mean or the way to handle the exception either by declaring in the method itself or you should supply the catch statement or handle it in the caller method or the class that is calling the super class method and when you compile it again it would go fine.
"Suppose a Super Class method throws an exception and this method is Overriden in the subclass with no exception. Now if you create a super class reference that has a subclass object. This throws a compile
Latest Answer: Because at run time  the super class will compiled first so it will gives the run time error. ..."
if the object has been created to the subclass and both the methods are non static then the method we overriden doesn't produce any errors or exceptions.
Super-class and Sub-class have method of same name. The programe compile easily but at run time it decide which method to be loaded. Weather sub-class or super-class. This concept is called as method over-riding.
According to Java compiler in case of over ridding always follow following rules: If a method of super class throws an exception then overridden version of that method in child class (sub class) should also throw same set of exceptions & should be properly handled. If you agree vote me sid
In this case we are calling a method with super class reference and sub class object. Super class reference can call only the methods which it knows (its knowledge) and execute sub class's defined method. So while we are calling method Super class has the knowledge that this method will throw an exception and need to handle this. Because of this the compiler shows error. Thanks