Flexible - converts snippets, files, and folders from C++ to Java
Fast - tens of thousands of lines converted from C++ to Java per minute
Helpful conversion comments
Excellent educational tool for C++ developers learning Java
Numerous conversion and formatting options
10 Second Overview
C++ to Java Array Conversion:
C++ to Java Collections Conversion:
C++ to Java Conversion of Modern C++ Features:
C++ to Java Indexer Conversion:
C++ to Java #define Constants Conversion:
*Scroll right to see C++ to Java Converter screenshots
Q: Are the original C++ files altered in any way?
Your existing code is left completely intact. The new
Java files are output to the new location that you specify.
Q: What is the conversion accuracy?
Our accuracy is very high, but there will be
significant adjustments required for all but the most trivial
conversions. There are no direct equivalents for some aspects of C++.
Read the rest of the FAQ to get an idea of a few things that are
not converted. C++ to Java Converter is intended to
reduce the amount of work you'll have to do to convert code to Java,
but it is just the first step.
You should not attempt to convert code that is heavily dependent
on pointer arithmetic or template metaprogramming since these
features are only practical in C++.
Q: What about function pointers?
C++ to Java Converter converts function pointer typedefs to functional interfaces.
Q: What about MFC and ATL?
The converter does not convert C++ UI types due to
the lack of correspondence between these types and Java types.
Q: What about STL Containers?
C++ to Java Converter converts references to most
STL container types, such as std::vector. A few methods of these containers that have no equivalent
are not converted.
Q: Is C++/CLI code converted?
Q: What are the most common adjustments necessary after conversion?
Most C/C++ library function calls are not converted.
However, we do convert a subset of the C-based
string, keyboard I/O, math, and utility function calls, and some of
the C++ keyboard I/O methods, STL-based string class methods,
and most STL containers.
Pointer arithmetic has no good equivalent in Java.
Some pointer and address manipulation may remain in the converted code.
Multiple inheritance is not converted since it is not available in Java.
Most operator overloads are converted, but a few operator overloads cannot be converted and are marked with a
Some function pointers cannot be converted to Java. Only function pointer
typedefs are converted to Java functional interfaces.
Since Java lacks a preprocessor, all code
dependent on conditional compilation needs to be refactored so
that the functionality can be achieved in other ways. You
can avoid this if you choose to target the NetBeans preprocessor
(C++ to Java Converter includes an option for this).
C++ templates are converted to, but are only
roughly equivalent to, Java generics. These may require further attention.
Template metaprogramming has no good equivalent in Java.
Bit-by-bit copying of objects via the
assignment operator is not the default in Java. We attempt
to detect these cases and convert the assignment to a call to
either the copy constructor (if used in a variable
initialization) or the converted assignment operator overload (which
is converted to a 'copyFrom' method) and also provide a 'Warning' comment.
Java does not allow embedded assembly instructions. These are marked with a comment.
There is no equivalent to friend functions or
friend classes in Java. These are marked with a comment.
Unions and bit fields have no elegant
equivalent in Java. Unions are commented out with a 'todo' note.