We consider a 1-parameter family of self-adjoint extensions of the Hamiltonian for a particle confined to a finite interval with perfectly reflecting boundary conditions. In some cases, one obtains negative energy states which seems to violate the Heisenberg uncertainty relation. We use this as a motivation to derive a generalized uncertainty relation valid for an arbitrarily shaped quantum dot with general perfectly reflecting walls in d dimensions. In addition, a general uncertainty relation for non-Hermitean operators is derived and applied to the non-Hermitean momentum operator in a quantum dot. We also consider minimal uncertainty wave packets in this situation, and we prove that the spectrum depends monotonically on the self-adjoint extension parameter. In addition, we construct the most general boundary conditions for semiconductor heterostructures such as quantum dots, quantum wires, and quantum wells, which are characterized by a 4-parameter family of selfadjoint extensions. Finally, we consider perfectly reflecting boundary conditions for relativistic fermions confined to a finite volume or localized on a domain wall, which are characterized by a 1-parameter family of self-adjoint extensions in the (1 + 1)-d and (2 + 1)-d cases, and by a 4-parameter family in the (3 + 1)-d and (4 + 1)-d cases.