4

I see the LinkedHashMap.eldest() method when attaching the source but cannot use it.

Any idea why it isn't available?

AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277

2 Answers2

4

It is a hidden method - invokable using reflection, but isn't part of the public API and therefore likely to change between versions of android

https://android.googlesource.com/platform/libcore/+/a47f800/luni/src/main/java/java/util/LinkedHashMap.java line 169 the @hide annotation stops it from being visible to the public

AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277
FunkTheMonk
  • 10,908
  • 1
  • 31
  • 37
0

Because there no such method in this class and any super type:

LinkedHashMap

HashMap

AbstractMap

Adam Radomski
  • 2,515
  • 2
  • 17
  • 28