Tool to Convert Java to C# Code

Convert Java to C# with a tool, or manually?

I would personally do it manually. You can reflect on where the Java design choices simply aren't appropriate for .NET, and end up with idiomatic C# code instead of code which looks very much like C# with a Java accent.

It also means you're more likely to understand the code at the end :)

Java to C# code converter

The below links might help:

  1. Microsoft Launches Java-to-C# Converter;
  2. Tangible Software Solutions inc..

Where can I find a Java to C# converter?

Java Language Conversion Assistant. Optionally installed with (at least) Visual Studio 2005 Standard Edition.

Select File/Open/Convert/Java Language Conversion Assistant.

Remember to manually go over the code afterwards. It will have lots of issues.

How should I convert Java code to C# code?

Your doing it in the only sane way you can...the biggest help will be this document from Dare Obasanjo that lists the differences between the two languages:

http://www.25hoursaday.com/CsharpVsJava.html

BTW, change all getter and setter methods into properties...No need to have the C# library function just the same as the java library unless you are going for perfect interface compatibility.

Convert java to c# .net

There are tools that can help do this. For example this one from the team who created db4o:

Smart java to c# conversion for the masses with sharpen

Note that these are not perfect and some constructs and API's cannot be easily translated.

Looking for the Code Converter which converts C# to Java

Disclaimer: No tool is perfect.

However, if you still want to try then there are these converters available:

  • CS2J
  • JCLA : Convert Java-language code to C#
  • Grasshopper
  • CSharpJavaMerger
  • Tangible Software C# to Java Converter

Not a converter but a bridge between .NET and the JVM:

  • JNI4NetBridge


Related Topics



Leave a reply



Submit