Connection between classical and statistical thermodynamics

Work?....Heat?....

How should we understand these classical terms in statistical mechanics?

$$U=\sum_jN_jE_j.$$

So,
$$dU = \sum_jE_jdN_j + \sum_jN_jdE_j.$$

Because $E_j = E_j(V)$, $\Rightarrow dE_j = (dE_j/dV)dV$, so the second term
becomes...
$$\sum_jN_jdE_j = \sum_j \(N_j\frac{dE_j}{dV}\)dV= - \sum_j Y\,dV.$$
That is, $Y=-\sum_j \(N_j\frac{dE_j}{dV}\)$.
[The negative sign is a reminder that with energy levels
of the particle in a box, $E_j \propto n_j^2/V^{2/3}$, as $V$ increases, the energy of level $j$ drops.]