When a solenoid that is carrying current is freely suspended, it comes to rest along a particular direction. This happens because:
The solenoid behaves like a bar magnet with fixed polarities at its ends when current flows through it
The solenoid behaves like a bar magnet with fixed polarities at its ends when current flows through it