Is there any advantage to using generic collections when you are only storing reference types?

StackOverflow https://stackoverflow.com/questions/5430877

문제

I have been reading a book and encountered a statement, that generics allow the programmer to avoid need of boxing and unboxing when using e.g. Stack.

I think it is not entirely correct as the Stack (not generic) could hold just reference type variables and then there is just casting, no boxing.

EDIT: AFAIK, boxing relates to only value types to object conversion. Is that correct or am I missing something?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top