<p style='text-indent:20px;'>From a given [<i>n</i>, <i>k</i>] code <i>C</i>, we give a method for constructing many [<i>n</i>, <i>k</i>] codes <i>C</i><sup>'</sup> such that the hull dimensions of <i>C</i> and <i>C</i><sup>'</sup> are identical. This method can be applied to constructions of both self-dual codes and linear complementary dual codes (LCD codes for short). Using the method, we construct 661 new inequivalent extremal doubly even [56, 28, 12] codes. Furthermore, constructing LCD codes by the method, we improve some of the previously known lower bounds on the largest minimum weights of binary LCD codes of length 26 ≤ <i>n</i> ≤ 40.</p>