How to find the total numbers of object created of my class?

前端 未结 0 1930
情歌与酒
情歌与酒 2020-12-03 16:32

For example, I have my class employee. I want to keep record how many employees till date have worked for me. I can make static count variable and add 1 in my constructor. B

相关标签:
回答
  • 消灭零回复
提交回复
热议问题