Ask Question

What output is displayed when the code that follows is executed? HashMap sales = new HashMap (); sales. put ("January", 389.45); sales. put ("February", 432.89); sales. put ("March", 275.30); for (Map. Entry sale : sales. entrySet ()) { System. out. println (sale. getKey () + ": " + sale. getValue ()); }

+3
Answers (1)
  1. 8 November, 07:56
    0
    March: 275.30

    January: 389.45

    February: 432.89

    Explanation:

    The code to be executed is a Java code. Since the For loop used is based on Sale, when the code is complied it will print the output in the order of sale as below:

    March: 275.30

    January: 389.45

    February: 432.89
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What output is displayed when the code that follows is executed? HashMap sales = new HashMap (); sales. put ("January", 389.45); sales. put ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers