Should I declare variable as interface even if I won't use it's features?

后端 未结 0 1097
被撕碎了的回忆
被撕碎了的回忆 2021-01-25 02:21

There is a HashMap instance. The only thing I will do with the instance is to call values() method described in the Map interface HashMap implements.

So I won\'t use any

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