Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #33310
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Java to C# translator |
| Date | 2015-12-05 19:39 -0500 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <n4004v$h0h$2@speranza.aioe.org> (permalink) |
| References | <a4ebd3b1.0306231128.27d675cd@posting.google.com> <2818693a-3f98-42ca-8361-3d7fc92b8d8b@googlegroups.com> <csharp-20151205140510@ram.dialup.fu-berlin.de> |
On 12/5/2015 8:06 AM, Stefan Ram wrote:
> hermsoftware@gmail.com writes:
>> On Monday, June 23, 2003 at 3:28:46 PM UTC-4, Liza wrote:
>>> why would anyone want to translate Java to C# ?
>> That's an effective answer!
>
> For simple programs, it is easy, You just replace the
> first three lines: So,
>
> public final class Main
> { public static void main( final java.lang.String[] args )
> { java.lang.System.out.println
> ( 1 + 1 ); }}
>
> becomes
>
> class Example
> { static void Main()
> { System.Console.WriteLine
> ( 1 + 1 ); }}
>
> . Some advanced programs use constants such as
> »java.lang.Math.PI«. Here, one must use the golden
> rule of Java-to-C#-translation:
>
> .--------------------------------------------.
> | Replace »java.lang.Math« by »System.Math«! |
> '--------------------------------------------'
>
> Thus,
>
> public final class Main
> { public static void main( final java.lang.String[] args )
> { java.lang.System.out.println
> ( java.lang.Math.PI ); }}
>
> becomes
>
> class Example
> { static void Main()
> { System.Console.WriteLine
> ( System.Math.PI ); }}
>
> . And I think that's it. Happy translation!
I don't expect anybody besides you to write Java or C# this way.
Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Java to C# translator hermsoftware@gmail.com - 2015-12-04 23:57 -0800 Re: Java to C# translator Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-05 08:22 -0500 Re: Java to C# translator Arne Vajhøj <arne@vajhoej.dk> - 2015-12-05 19:39 -0500
csiph-web