Tangible Software Solutions
The Most Trusted Name in Source Code Conversion
Java does not allow optional parameters. Overloaded methods are the only alternative in Java to optional parameters (these are inserted into the converted code by C++ to Java Converter). A C++ method with n optional parameters is converted to n + 1 overloaded methods. The overloaded methods call the overloaded method with the maximum number of parameters (which contains your original method code), passing the default values originally specified for the original optional parameters.
Here's an example of the simplest possible case:
void TestOptional(int x = 0)
public void TestOptional()
public void TestOptional(int x)
If you need to convert from C++ to Java and you are depending on the results being reliable and accurate, then you will want to have C++ to Java Converter, the best C++ to Java converter, at your fingertips.
Copyright © 1997 - 2017 Tangible Software Solutions Inc.