Monday, 26 August 2013

Currency class only one instance per currency?

Currency class only one instance per currency?

From this official oracle java tutorial:
Note that the Currency class is designed so that there is never more than
one Currency instance for any given currency. Therefore, there is no
public constructor. As demonstrated in the previous code example, you
obtain a Currency instance using the getInstance methods.
What is the risk of having more than one instance of Currency for a given
currency? Thanks in advance.

No comments:

Post a Comment