-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
  • 3,598
  • 5
  • 37
  • 53
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
  • 71,965
  • 6
  • 74
  • 110