0

I have the following code, but when I run, I don't even get a number and I'm not sure why. do I have to use a different constructor? I tried but one of the arguments in a different constructor is a random number generator, and won't let me put in any sort of number for it. And please guys, be nice, I know I Don't know very much about distributions or java, I'm just learning.

import org.apache.commons.math3.distribution.TDistribution;

public class Math33 {
    public static void main(String[] args){
        TDistribution TScore = new TDistribution(1, 5);
        System.out.println(TScore);
    }
}

I get this as output:

org.apache.commons.math3.distribution.TDistribution@18f55759
Logan
  • 51
  • 10
  • you are calling the toString method here `System.out.println(TScore)` (http://www.javatpoint.com/understanding-toString()-method) but you should use the methods returning a double: https://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/distribution/TDistribution.html – Meiko Rachimow Apr 03 '16 at 15:42

1 Answers1

0

Because you put an object of TDistribution into method System.out.println() so it's print you a string presentation of the object. What you need is to call so of TDistribution's methods inside System.out.println(). For example:

System.out.println("" + TScore.getNumericalVariance());

or any other which is available for TDistribution