As a consequence of their work, Bruce C. Berndt, Ronald J. Evans, Larry Joel Goldstein and Michael Razar obtained a formula for the square of the class number of an imaginary quadratic number field in terms of Dedekind sums. We give a short proof of it and also express the relative class numbers of imaginary abelian number fields in terms of Dedekind sums.