We study the problem of canonical quantization of classical scalar and Dirac field theories in the finite volumes respectively in this paper. Unlike previous studies, we work in a completely discrete version. We discretize both the space and time variables in variable steps and use the difference discrete variational principle with variable steps to obtain the equations of motion and boundary conditions as well as the conservation of energy in discrete form. For the case of classical scalar field, the quantization procedure is simpler since it does not contain any intrinsic constraint. We take the boundary conditions as primary Dirac constraints and use the Dirac theory to construct Dirac brackets directly. However, for the case of classical Dirac field in a finite volume, things are complex since, besides boundary conditions, it contains intrinsic constraints which are introduced by the singularity of the Lagrangian. Furthermore, these two kinds of constraints are entangled at the spatial boundaries. In order to simplify the process of calculation, we calculate the final Dirac brackets in two steps. We calculate the intermediate Dirac brackets by using intrinsic constraints. And then, we obtain the final Dirac brackets by bracketing the boundary conditions. Our studies show that we can not only construct well-defined Dirac brackets at each discrete space-time lattice but also keep the conservation of energy discretely at the same time.