'Sweet are the uses of adversity' this line is related to which play of Shakespeare?

'Sweet are the uses of adversity' this line is related to which play of Shakespeare?

Explanation
  • This line appears in As You Like It (Act 2, Scene 1) spoken by Duke Senior.
  • It means that hardships can be beneficial, bringing wisdom and growth.