I have been lurking the net for a while now, but haven't found an answer to this yet.
Someone is mentioning Class<T>
as key here on SO (I think) but I can't find the post anymore.
In any case, this question deserves a proper answer (apologizing if there is a thousand post thread on it).
Is Class<T>
immutable? Can it be safely and efficiently used as key (constant hashCode()
over execution) ?
My guess would be yes, because the Class definition doesn't change at runtime. But I am not quite sure...thank you!
EDIT: talking about Java.