O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Java Versus .NET Languages

Note

To do a decent comparison between the CLR and a JVM, it makes sense to install Java. The discussions in this Appendix assume use of Java 1.4 of Java and the associated PDK from Sun (http://developer.java.sun.com/developer/index.jshtml).

Look at Listing D.1, which shows the simplest of Java programs.

Listing D.1. Hello World in Java
// To compile and run
// javac -classpath . helloworld.java
// java HelloWorld
// (case is important)
class HelloWorld
{
    public static void main(String[] args)
    {
        System.out.println("Hello World from Java!");
    }
}

Compiling this program produces a class file called HelloWorld.class. To run the program, type java HelloWorld. With Java, you specify a class name to run. Running this program ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required