Runtime type safety

With a firm grap of type erasure it is time to explore which of the three languages offer runtime type safety. For example, if a generic list is instantiated at compile time as a list of integers, can a string be added to the list at runtime? Let’s take a look!

  • Java: will its type erasure prevent Java from having runtime type safety?
  • .NET: how safe is .NET’s common language runtime (CLR)?
  • Golang: and finally, what about Go?

Next: Java