CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2008
    Posts
    20

    Using both C# and Java

    Hi Guys....Can any1 tell me how we can use both C# and Java in a single application....for example i want to add two numbers ...is it possible to do like.....create front end(GUI) using C# and then do back end in Java (adding both the numbers) .....and then displaying it back on the screen...can any1 please help me on this.....

  2. #2
    Join Date
    May 2009
    Posts
    2,413

    Re: Using both C# and Java

    Quote Originally Posted by laptop545 View Post
    Hi Guys....Can any1 tell me how we can use both C# and Java in a single application....for example i want to add two numbers ...is it possible to do like.....create front end(GUI) using C# and then do back end in Java (adding both the numbers) .....and then displaying it back on the screen...can any1 please help me on this.....
    Unfortunately Java isn't a .NET language anymore. It once was (called J#) but it's been retired. So the approach you're suggesting isn't that easy.

    Question is why do you need to mix C# and Java really?

    If you have code in Java and now want to discard it in favour of C# it shouldn't be too hard to just port it.

  3. #3
    Join Date
    Aug 2005
    Posts
    198

    Re: Using both C# and Java

    Quote Originally Posted by nuzzle View Post
    Unfortunately Java isn't a .NET language anymore. It once was (called J#) but it's been retired.
    Java was never a .NET language.
    Microsoft put out a .NET version called J# based on an outdated Java standard in the early 2000's, but it was not very successful. This was the follow-up to an earlier version called J++ in the late 90's based on an earlier outdated Java standard - also not very successful.

    If you're thinking of porting one way or the other, your biggest challenge is event handling - the .NET model and the indirect Java approach are worlds apart. No converter will handle this aspect.
    Last edited by David Anton; August 23rd, 2009 at 07:59 PM.
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

  4. #4
    Join Date
    May 2009
    Posts
    2,413

    Re: Using both C# and Java

    Quote Originally Posted by David Anton View Post
    Java was never a .NET language.
    Sorry David Anton, but you're dead wrong. At least according to Wikipedia,

    http://en.wikipedia.org/wiki/Microsoft_.NET_Languages

    If you look in the list of "common .CLI languages" you'll find J# for sure (and it's been discontinued as I claimed).
    Last edited by nuzzle; August 31st, 2009 at 06:38 PM.

  5. #5
    Join Date
    Aug 2005
    Posts
    198

    Re: Using both C# and Java

    J# was an obscure (and inferior) .NET implementation of an outdated Java standard - this does not exactly render the statement that "Java is a .NET language" as truth.

    Ask 999 out of 1000 of your fellow Java developers and they'll say Java is not, and never was, a .NET language. Wikipedia isn't exactly the most credible source for everything, as you probably realize.

    So, to not be misleading, you could say "There was once an inferior .NET implementation based on an outdated (even at the time) Java standard called J#", but certainly not "Java is a .NET language".
    Last edited by David Anton; August 31st, 2009 at 07:28 PM.
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

  6. #6
    Join Date
    May 2009
    Posts
    2,413

    Re: Using both C# and Java

    Quote Originally Posted by David Anton View Post
    J# was an obscure (and inferior) .NET implementation of an outdated Java standard - this does not exactly render the statement that "Java is a .NET language" as truth.

    Ask 999 out of 1000 of your fellow Java developers and they'll say Java is not, and never was, a .NET language. Wikipedia isn't exactly the most credible source for everything, as you probably realize.

    So, to not be misleading, you could say "There was once an inferior .NET implementation based on an outdated (even at the time) Java standard called J#", but certainly not "Java is a .NET language".
    Congratulations! You now belong to a very select group of stupid people who just cannot admit they're wrong.

  7. #7
    Join Date
    Aug 2005
    Posts
    198

    Re: Using both C# and Java

    No need to get into insults.

    Java is bigger than .NET and existed long before .NET.

    Java proper has never run on .NET - it always has had its own unique libraries.
    Even the syntax of J# was not compliant with any Java standard.

    How about a poll? "Was Java ever a .NET language?".
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

  8. #8
    Join Date
    May 2009
    Posts
    2,413

    Re: Using both C# and Java

    Quote Originally Posted by David Anton View Post
    How about a poll? "Was Java ever a .NET language?".
    Is this something you learn at school today? 1+1 is 2 only maybe. Maybe it's 3 or even 13? Let's have a poll to figure.

    Cut the crap for heaven's sake and get down to the fact that you've been shown wrong. Counter with some tangible evidence like a reference or something.
    Last edited by nuzzle; August 31st, 2009 at 09:40 PM.

  9. #9
    Join Date
    Aug 2005
    Posts
    198

    Re: Using both C# and Java

    Sure - you win.

    Java was a .NET language. This must be obvious from the fact that about .1% of Java-like code was written in J# for a couple of years until even Microsoft gave up on it. Of course I was being argumentative by assuming that Java wasn't a .NET language because 99.9% of Java code was written in 'Java', not J#.

    You could also go on the C++ forums and claim that C++ is currently a .NET language simply because there is a .NET implementation of C++ (C++/CLI), having roughly the same popularity that J# did. Of course, you won't find any C++ programmers agreeing with that.
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

  10. #10
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Using both C# and Java

    David, you were right about J# - it was a .NET language using Java-like syntax, but it wasn't Java.

    The Java language is more than just Java syntax, as anyone who has read chapters 12 and 13 of the Java Language Specification will know.

    So, according to the Java Language Specification, J# wasn't an implementation of Java, though it did use Java-like syntax.

    It is a bad plan that admits of no modification...
    P. Syrus
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured