DEV Community

Discussion on: Java is Unsound: The Industry Perspective

Collapse
 
rosstate profile image
Ross Tate

Right. I simplified things for pedagogical purposes. The compiler inserts casts in order to make the resulting bytecode well typed. Since typically the result of strs.get would be used as a String, typically the cast is inserted. But examples such as yours show that this is not always done.