In a closed system of a particular volume with mixture of gases, each gas inside exerts a partial pressure which is also its pressure when it is alone in the same container.
The sum of the partial pressures of the gases inside the system is the total pressure. It can be summarized as:
`p_(t otal) = p_(gas A) + p_(gas B) + p_(gas C) + ... + p_(n)`
For the problem above,
`p_(t otal) = p_(O_2) + p_(H_2O)`
`p_(t otal) = 595 t o rr `
`p_(H_2O) = 30.0 t o rr `
`p_(O_2) = 595 - 30.0 ` = 565 torr
Dalton's Law states that the total pressure of a gas equals the pressures of each individual gas added together.
The problem that you have described involves collecting oxygen over water vapor, meaning that the two gases involved are O2 and H2O.
P(total) = P(O2) + P(H2O)
P(O2) = P(total) - P(H2O)
P(O2) = 595 - 30 = 565 torr