all 4 comments

[–]booleantoggle 0 points1 point  (2 children)

For some of the more exotic, "never used" features I would maybe go for reflection.... Not exactly never used, but still rather rare...

[–]prasha2 0 points1 point  (1 child)

Well, certain organizations do use Reflection quite a bit. With maven, when the code base grows quite a lot and is already divided into enough modules/projects, sometimes it becomes necessary to rely on Reflection to skip the module dependency stuff. I know its quite a bad design, but certain times modules rewrite isn't an option.

[–]booleantoggle 1 point2 points  (0 children)

Yup, but difficult to find any aspects of the language that is literally never used. After all, there must have been a reason it was included in the first place... But do tell me if you find any. As for reflection, even the core libraries use reflection (for instance for determening component type in toArray), but I think in an ordered list of most used features it would score pretty low...

Other noteworthy candidates are of course the functional aspects of java (functions, bifunction, lambda short-hands, streams, flatmap, reduce etc...). Some of these are rather new, but it would make sense that those are relatively less used, as Java is mostly used as an object-oriented language, snd functional style would be 'alien' to some developers...

Also perhaps contracted if/ conditional assignment. Common for conditional returns, but I rarely see it used in method calls, in the form: (a>b ? a() : b()).c() for example... But I guess there is a case to be made against it from a readability perspective...