Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why ConcurrentHashMap.Segment and ConcurrentHashMap.HashEntry classes are static?

Why ConcurrentHashMap.Segment and ConcurrentHashMap.HashEntry classes are static? Why it is designed in this way ?

like image 713
Vipin Avatar asked Nov 21 '13 15:11

Vipin


1 Answers

Basically all inner classes which does not need to use the properties of their enclosing classes are supposed to be static. This comes from the general principle in java which says that every object should have access to the least possible other objects.

like image 70
Adam Arold Avatar answered Sep 27 '22 22:09

Adam Arold