Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well in most statically typed languages with a VM (Java/C#), there's some sort of runtime validation

In Java Object something = new Map(); String badCast = (Object) something; // This line would throw a ClassCastException because something is not a String

This has the advantage of throwing an exception in the correct place, instead of somewhere down the line.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: