GIDForums  

Go Back   GIDForums > Computer Programming Forums > Miscellaneous Programming Forum > Computer Programming Advertisements & Offers
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Oct-2009, 01:05
sindy55 sindy55 is offline
New Member
 
Join Date: Oct 2009
Posts: 1
sindy55 is on a distinguished road

Convert between C# and Java with CSharpJavaMerger


CSharpJavaMerger is an open source tool. It provides common interfaces of C# and Java and enables you to write one set of code which can be used both by C# and Java.

Below is a method that can be used in both of C# and Java. In the sample, CString is a class defined in the CSharpJavaMerger Framework.

JAVA Code:
public void AddTwoValues()
{
    try
    {
        CString strValue1 = m_mainForm.GetFirstTextBoxValue();
        CString strValue2 = m_mainForm.GetSecondTextBoxValue();

        int iValue1 = strValue1.ToInteger();
        int iValue2 = strValue2.ToInteger();
        int iResult = iValue1 + iValue2;
        CString strShowResult = CString.ValueOf(iResult);
        m_mainForm.ShowResult(strShowResult);
        CString strSaveResult = new CString(strValue1.GetValue() + " + " + strValue2.GetValue() + " = " + strShowResult.GetValue() + "\n");
        m_mainForm.SaveResult(strSaveResult);
    }
    catch (Exception ee)
    {
        m_mainForm.SaveResult(new CString(ee.Message + "\n"));
        m_mainForm.ShowResult(new CString("Error"));
    }
}


More info on CSharpJavaMerger: www.kevingao.net
Last edited by LuciWiz : 11-Oct-2009 at 11:27. Reason: Please insert your Java code between [java] & [/java] tags
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert PDF file into EXCEL using JAVA sudhaselvaraj Java Forum 3 29-May-2008 08:51
please convert this to java code.thank u. lolok Java Forum 1 02-Dec-2006 23:01
Scalability in Java and C++ agx Miscellaneous Programming Forum 7 04-Feb-2006 16:35
Convert Java to C++??? leanieleanz C++ Forum 1 04-Mar-2005 20:06

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:51.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.