Wednesday, 11 September 2013

Accessing arrays with methods

Accessing arrays with methods

Hi guys i'm just starting to learn Java, and I wondering how can I access
an array that was declared in a method from another method? The design
look like this:
public class Arrays{
int arraysize = 2;
public void initializeArray(){
float array[] = new float[arraySize]; // Declare array
}
public void accessArray(){
// I want to access the array from this method.
}
}

No comments:

Post a Comment