Question: ( 1 0 points; 2 points each ) One of the most important innovations in Java was internationalization. Before Java, all programming languages were US

(10 points; 2 points each) One of the most important innovations in Java was internationalization. Before Java, all programming languages were US centric (most remain English-centric). When Java was designed it was clear that this wasn't going to suffice. So Java integrated classes in the API that generalize attributes of things like dates, currency, and time.
Use the methods in the Currency class in the API to write a code fragment that performs each of the following actions.
a. Write the import statement that will allow you to use the Currency class.
b. Declare and construct a Currency object with reference U.S. dollars using the static getInstance() method in the Currency class. The String that represents U.S. dollars is "USD". Static methods that return a reference to a newly constructed object are called factory mothnds This is a verv common trick to conceal constructors.
c. Print out the number of fractional digits that are used in U.S. dollars using the object from b).
d. Print out the numeric code that is used to represent U.S. dollars using the object from b).
e. Print out the symbol that is used to represent U.S. dollars using the object from b).
( 1 0 points; 2 points each ) One of the most

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!