I am using Scala to do some work with Java’s reflection API. But I can’t seem to figure out how to access in Scala what in Java would be: int.class, float.class, boolean.class.
Basically the classes objects that represent the primitive data types.
So what is the Scala version of int.class?
int.class, float.class, etc. do not exist. The equivalent boxed types each have a static field called
TYPEwhich represents the primitive type. Is this what you mean?e.g. for int/Integer:
http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#TYPE
If so, you reference it from Scala just like you would in Java: