Write the output that is printed when the given method below is passed each of t
ID: 3855317 • Letter: W
Question
Write the output that is printed when the given method below is passed each of the following maps as its parameter. Assume that each parameter map stores its key/value pairs in exactly the order shown, and that is the order in which a for-each loop would examine them. Recall that maps print in a {key1=value1, key2=value2, ..., keyN=valueN} format. Your answer should display the right values in the right order.
{sheep=wool, house=brick, cast=plaster, wool=wool} {munchkin=blue, winkie=yellow, corn=yellow, grass=green, emerald=green} {pumpkin=peach, corn=apple, apple=apple, pie=fruit, peach=peach} {lab=ipl, lion=cat, terrier=dog, cat=cat, platypus=animal, nyan=cat}Explanation / Answer
sheep=wool, house=brick, cast=plaster, wool=wool}
OUTPUT : [brick, plaster]
{munchkin=blue, winkie=yellow, corn=yellow, grass=green, emerald=green}
OUTPUT : [blue, green, yellow]
{pumpkin=peach, corn=apple, apple=apple, pie=fruit, peach=peach}
OUTPUT : [apple, fruit]
{lab=ipl, lion=cat, terrier=dog, cat=cat, platypus=animal, nyan=cat}
OUTPUT : [animal, cat, dog, ipl]
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.