The term "placement new" itself is somewhat ambiguous. The term is used
in two different ways in the C++ standard, and thus by the C++
community.
The first meaning refers to any overloaded operator new
function
which has more than one parameter. The additional parameters can be
used for just about anything—there are two examples in the
standard itself: operator new(size_t, void*)
and operator new(size_t,
std::nothrow_t const&)
.
The second meaning refers to the specific overload operator new(size_t,
void*)
, which is used in fact to explicitly call the constructor of an
object on memory obtained from elsewhere: to separate allocation
from initialization. (It will be used in classes like std::vector
,
for example, where capacity()
may be greater than size()
.)
In Java, memory management is integrated into the language, and is not
part of the library, so there can be no equivalents.