It is not completly clear what you want to achieve but i will try to answer anyways.
Option 1: You said you want to assign a variable in method a from method b in a nested class. That is not directly possible since function-variables are not accessible from another function and do no longer exist when the function has finished its execution. so you could transfer it as a input-parameter:
public class A {
public void a(String[] input){
String[] theArray = input;
}
private class B{
private void b(){
String[] input = new String[] {"an", "awesome", "Test"};
a(input);
}
}
}
Option 2: Use a member-variable:
public class A {
private String[] theArray;
public void a(){
this.theArray = new String[] {"a", "nice", "Test"};
B bObject = new B();
//modify value within b():
bObject.b();
//or assign it using a return value:
this.theArray = bObject.b2();
}
private class B{
private void b(){
theArray = new String[] {"an", "awesome", "Test"};
}
private String[] b2(){
return new String[] {"an", "awesome", "Test"};
}
}
}
Bis notstaticyou will have to create an instance of classBthen call the method from classBpassing the array from classAas a parameter...