"It is easy to make one for classes you define in C++ with operator overloading ( and i believe such thing is possible also in java) , but when talking about primitive types such as int, double and so on , you will have to use library function like Math.power (and usaully have to cast both to double)." . . . .