开发者

For R & Java Connection

I write this program

import java.util.Vector;
import org.rosuda.Rserve.*;

class rNumber {
  public static void main(String[] args){
    public class RConnection  extends Rengine{
      RConnection c = new RConnection();
      double d[] = c.eval("rnorm(10)").asDoubles(); 
    }
  }
}

thi开发者_如何学运维s program give error illegal start of expression & ; is expected


You can't declare a public class inside a main function... Declare the class outside. Besides, I don't see the point of your rNumber class.

You might do something like this instead :

  import java.util.Vector;
  import org.rosuda.Rserve.*;

  public class RConnection  extends Rengine{
    public static void main(String[] args){
      RConnection c = new RConnection();
      double d[] = c.eval("rnorm(10)").asDoubles(); 
    }
  }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜