How can I get an Object's name in java?

后端 未结 9 1801
陌清茗
陌清茗 2020-12-10 05:30

like this, A a = new A(), how can I get a\'s name?(Get a String \"a\" from a) ?


There is a JPanel contains some JTextFields, a map contains all the JTextFields

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 06:05

    The replication of the name (symbol) a is what is inconvenient and a bit noisy. In a language with macros, one could define this so that the copying would be automatic in the source code program.

    make(A, a);
    

    or makeA(a)

提交回复
热议问题