Java- Where does the variable name or Identifier gets stored, Stack or Heap?
问题 Where does the identifiers or variable name gets stored in java? I understand that objects get stored in heap and variable gets store in heap or stack depending on the type and scope of variable. Can we debug or write any program to confirm it? Thanks & Regards 回答1: Names of fields are stored as part of the class metadata, in formerly-PermGen now-Metaspace. Array elements don't have names, only numbers. (Cue Patrick McGoohan.) Names of method and constructor parameters and local variables and