Component- and package diagrams can communicate hierarchies, as both UML components and packages can be nested.

For examples, see the following questions: