dimanche 24 septembre 2017

Scala- How to get a Vector's contained class?

Does Scala have a way to get the contained class(es) of a collection? i.e. if I have:

val foo = Vector[Int]()

Is there a way to get back classOf[Int] from it?

(Just checking the first element doesn't work since it might be empty.)





Aucun commentaire:

Enregistrer un commentaire