How to give input for the double[] array in Java
<p>How do I give input directly, when that function is invoked in another method, especially when that input is a <code>double[]</code> array?</p>

<pre><code>public double dotPro1(double[] vectorA, double[] vectorB) {
    double[] vecPro;
    vecPro = new double[2];
    vecPro[0] = vectorA[0]*vectorB[0];
    vecPro[1] = vectorA[1]*vectorB[1];
    return vecPro[0] + vecPro[1];
}
public double dotPro2(double[] length) {
    double[] lenPro;
    lenPro = new double[1];
    lenPro[0] = length[0];
    return lenPro[0];
}
public static double cosine(double a) {
    double x = Math.cos(Math.toRadians(a));
    /*Class c = Class.forName("NaiveStrategy");
        Class methodTypes[] = new Class[3];
        methodTypes[0] = Double.TYPE;
        methodTypes[1] = Double.TYPE;
        methodTypes[2] = Double.TYPE;
        Method[] m = c.getMethods();*/
    NaiveStrategy ns = new NaiveStrategy();
  problem--&gt;ns.dotPro1(vectorA[], vectorB[]);
  problem--&gt;ns.dotPro2(length[]);
    return 0;  
}
</code></pre>

<p>As you can also see my old coding I tried in another way to solve it, but it didn't worked. It's commented out above.</p>
