if battery in an electromagnet is active then the nail in the electromagnet will become magnetic & the teacher connects the unwire ecosystems an tin hammer to a compress ->  the iron nail will become magnetic  the tin hammer will become magnetic & a nail is a kind of object & magnetic attraction pulls two objects together -> the iron nail will attract another iron nail because the iron nail is magnetic