I have a Java program in which I need to accept the command line arguments in an array as input in the main method, and then need to pass the array to a constructor of another class in the same program. I need to know how to declare the array globally and then how to pass it and take it in the constructor.
Thanks
And you can create
AnotherClassYou can run using
javac Example.javajava Example