This question has options. Is the word "end" used in the same way in the following two sentences?

One end of the box was marked 'This side up'.

The ends justify the means.

Pick from: (1). different meanings. (2). the same meaning.
(1).