Answer:
This depends because the electrostatic force obeys the principle that states that force between both of the particles does not get affected by the charges of the other thus if the needle is getting attracted it possess negative charges( the opposite charge) .And if they repel it means they have the same charges ( positive charges).