-1

If I have a method

doSomething(float[][] a)

and want to pass parameter to this method from main,

What is the syntax for floats in this example?

DanielM
  • 2,604
  • 5
  • 28
  • 41
Deaddave19
  • 11
  • 3

1 Answers1

0

The two common ways are as follows:

public class Main {

    public static void main(String args[]) {
        doSomething(new float[][] {{1,2},{3,4}});
        float x[][]=new float[][] {{1,2},{3,4}};
        doSomething(x);
    }

    static void doSomething(float[][] a) {

    }
}
Arvind Kumar Avinash
  • 62,771
  • 5
  • 54
  • 92