A.java
public Class A
{
String a,b;
public static void setArray(String[] array)//This is where i want the array to come
{
array[0]=a;
array[1]=b
}
}
B.java
public class B
{
String[] arr1 = new String[2];
arr1[0]="hello";
arr1[2]="world";
public static void main(String[] args)
{
A a = new A();
a.setArray(arr1);//This is from where i send the array
}
}
I am trying to send an array from one class to another class