4 ms·
You can take a view of types that is broader than the one Java actually uses such that an NPE is a 'runtime type error' but you can do that with lots of runtime
by pvg 8y ago
You can take a view of types that is broader than the one Java actually uses such that an NPE is a 'runtime type error' but you can do that with lots of runtime errors. It's not what the poster is talking about.
- koala_man 8y agoYou sure could -- Coq programmers might say that any error is a runtime type error. I don't think NPEs go much beyond Java's own definition though. If you have a reference to a String, it's not necessarily of type String. You'd get a runtime error if you try to treat it as such, just like you would in Python. This is not the case in C++, though obviously it's not an example of template metaprogramming.