With the connection of the wire ends to the battery, the circuit will be completed and current will flow through the wire, creating your very own electromagnet. Test it, by bringing it near iron filings, which will immediately cling to it. Use a low power, 1.5 V battery, to be on the safer side.