开发者

Compile-time error or runtime error

开发者 https://www.devze.com 2023-01-19 01:05 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号