Yes! A cube is a type of rectangular prism. I can use the formula 2l×w+2w×h+2(l×h), but l, w, and h all have the same value, so the result is the same as using for formula 6s2.