简体   繁体   中英

Compile-time error or runtime error

for example Class B extends A . An object A test= new B (x,y) ; Then a method 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM