Which of the following statements about a bar magnet is correct?