Compile-time error or runtime error
for example Class B extends A
.
An object A test= new B (x,y)
;
Then a m开发者_JAVA技巧ethod that there is only on Class B
is invoked on the test
object.
Will it be a Compile time error or a run time error?
Overall what are the different between both errors.
It's a compile time error. (See here)
A compile time error is when the compiler can't understand what you wanted to do.
There is a lot of conditions to have a compile-time error but basically it's when the syntax you used either confuses the compiler or isn't valid at all.
精彩评论