954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Convert Java to C#

Hi,

Iam new to java as iam working for dotnet C#.
Can any body tell me the software to convert java code to C#.
Please, iam in very much need for it.

Thanks in advance,
Anjali ...

kanjali
Newbie Poster
13 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

Who says there is any?

I find it extremely lazy of people to expect there to be software programs that will convert code from one language into code from another. Both languages will have there own idioms, syntax, and "way of doing things", and it is almost guaranteed (regardless of which 2 languages are involved) that a "converter" program would be able to create syntactically correct, and runtime efficient code.

I have seen converters for other languages, and although they created code that was syntactically correct, it was nothing I ever wanted to actually use.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

IF you know C# then you will have little difficulty converting it to java on your own. It will not take you much time to read a few things about java. If you know C# you don't need to learn anything new, just understand a few things about how java works.
If you know C# and you didn't just find someone else's code and you want to convert it to java for your assignment.

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 
IF you know C# then you will have little difficulty converting it to java on your own. It will not take you much time to read a few things about java. If you know C# you don't need to learn anything new, just understand a few things about how java works. If you know C# and you didn't just find someone else's code and you want to convert it to java for your assignment.

Yeah I agree...

Knowing C# takes some fair Java and C language know-how, along with the idea of delegates, partial classes, unsafe context, "member variables," etc...

Alex Edwards
Posting Shark
972 posts since Jun 2008
Reputation Points: 392
Solved Threads: 109
 

I been told that if you can get Java application running in Visual J++ VS2005 and VS2008 should do the conversion for you. Reality, I never try it, I love Java too much...:*

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

Thanks a lot, for suggestions.
I will try to convert it by myself. As it was in very much need and of short time , i thought about some software to convert.
Ya, i will shurly try to do it.

Thanks a lot,
Anjali ..

kanjali
Newbie Poster
13 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

well what if some one is intrested in writting a module that could actually convert java to C#,
I have got an assignment to write such sw which i am afraid not as simple as its title suggests,,,
i will really appreciate if some one could give me some idea that what will be the starting point for this sw... plz mail me at [email]mian_ghous@yahoo.com[/email] , if any one of you have any idea how to do this

mian_ghous
Newbie Poster
1 post since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

public String encrypt(String plaintext) throws Exception {
MessageDigest md = null;

md = MessageDigest.getInstance("SHA");

md.update(plaintext.getBytes("UTF-8"));

byte raw[] = md.digest();

String hash = (new BASE64Encoder()).encode(raw);

return hash;
}

nikhil kawatra
Newbie Poster
1 post since Jul 2010
Reputation Points: 9
Solved Threads: 0
 

What does that have to do with anything.

To ask a question, start a new thread.

Closing this thread.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You