What is Stateless Object in Java?

前端 未结 10 1412
猫巷女王i
猫巷女王i 2020-11-30 21:32

Currently I\'m reading \"Java concurrency in practice\", which contains this sentence:

Since the action of a thread accessing a stateless object can\'

10条回答
  •  时光取名叫无心
    2020-11-30 21:48

    An objects that have absolutely no state then there is no problem with reusing them at this point the question is: if they have absolutely no state why not make all the methods static and never create one at all?

提交回复
热议问题