There are two type of magnets—ferromagnets that can sustain a permanent magnetic field, and electromagnets produced by the flow of current.