Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why hasn't Scala replace Java yet?

Name: Anonymous 2012-07-08 10:47

>Functional programming
>Better syntax
>Better frameworks
>Better threading and concurrency
>Better garbage collection
>Better Hello World:

Scala:
println("Hello, world!")

Java:
package helloworld.beans;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.ejb.Remote;
import javax.ejb.Stateless;

@Remote
public interface HelloWorldRemote
{
    public String helloWorld();
}

@Stateless
public class HelloWorldBean implements HelloWorldRemote
{
    @Override
    public String helloWorld()
    {
        return "Hello, world!";
    }
}

public class Main
{
    public static void main(String[] args)
    {
        System.out.println("Starting...");

        System.out.println("Establishing connection to the bean...");
        HelloWorldBean hwBean;
        try {
            InitialContext initialContext = new InitialContext();
            hwBean= (HelloWorldBean) initialContext.lookup("java:global/HelloWorldBean");
            System.out.println(hwBean.helloWorld());
        }
        catch (Exception ex)
        {
        Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
            System.exit(-1);
        }
    }

}

Name: Anonymous 2012-07-08 11:48

Better garbage collection
Don't they both run on the JVM?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List