Here it is:
Write a method that creates and initializes a 2-D array of double. The size of the array is determined by the arguments of the methods, & the initialization values are a range determined by beginning and ending values that are also arguments of the method. Create a second method that will print the array generated by the first method. In main() test the methods by creating and printing several different sizes of arrays.
My question: How do I create a method that belongs to no class inparticular, in Java? I must've skipped this part somewhere in Jia.
I've tried it like this:
public class classA {
public static void main(String[] args) {
void doSomething(Type argument) {
// compiler does not allow me to do this.
// ...
Plus I'm assuming that the method isn't supposed to belong to main(), since the question specifies that main() should test these methods. I also can't create global methods either, as the compiler complains there too. HELP!