  Let ${\mathcal T}(n,m)$ and ${\mathcal F}(n,m)$ denote the classes of
weighted trees and forests, respectively, of order $n$ with the positive
integral weights and the fixed total weight sum $m$, respectively. In this
paper, we determine the minimum energies for both the classes ${\mathcal
T}(n,m)$ and ${\mathcal F}(n,m)$. We also determine the maximum energy for the
class ${\mathcal F}(n,m)$. In all cases, we characterize the weighted graphs
whose energies reach these extremal values. We also solve the similar maximum
energy and minimum energy problems for the classes of (0,1) weighted trees and
forests.
