Re: Writing apps for Windows platform in Java? Why?



I don't know about the future but I've just done a test now and Java ran
a lot faster then .NET. If you wanna test yourself just do the
following: Create a simple GUI with a text area and a button. On a
button click event put the following code:

JAVA

String st = "a";
for (int i = 0; i < 30000; i++ ) {
textArea.setText(st);
st += "a";
}
System.exit(0);

C#
string st = "a";
for (int i = 0; i < 30000; i++ ) {
textArea.Text = st;
st +="a";
}
this.Close();

The results I got executing this code, on the same machine, were:

Java, executed in 1 minut and ~40 seconds, used near to 30 MB of RAM.

C# .NET, didn't finished executing in more than 5 minuts, so I ended it
by force. Used near to 10 MB of RAM during this time.

I don't know what you might think, but for mem Java performed a lot
better even though it used more RAM.

The Versions used ware: JVM 1.5.0_07
.NET 2.0 (Visual C# Express 2005)
.