Why not just use a Boost Array? That's the closest equivalent to a Java array.
It has all the type safety and container functions without the overhead of a vector.
1. This is For Beginners, as such boost is generally a no-no. Heck, even our template skulldrudgery up above shouldn't be here.
2. "overhead of a vector" is a misnomer. It has the same amount of overhead as an array. One would use boost array instead of a vector in the case when one has a statically sized array but would like the advantage of a uniform interface (begin(), end(), etc.) for access to the array.