The following is the Proposition 1.10 of Hartshorne's Algebraic Geometry:
If $Y$ is a quasi-affine variety, then $\dim Y =\dim \overline{Y}$.
In the proof, there is a statement saying that if
$$ Z_0 \subset \cdots \subset Z_n \;\;\; (1) $$
is a maximal chain of distinct irreducible closed subsets of $Y$, then
$$ \overline{Z}_0 \subset \cdots \subset \overline{Z}_n \;\;\; (2) $$
is also a maximal chain of distinct irreducible closed subsets of $\overline{Y}$ refering to the example (1.1.3) which is
Any nonempty open subset of an irreducible space is irreducible and dense.
I can't understand this. Yes, Y is an open subset of an affine variety. Then, what ? Help me!