title: Getters, Setters, Arrays
body: <p>I am unsure if this is possible or not. I've done my research and didn't find much at all. This proves very difficult for me and I'm just hoping there is a way.</p>
  
  <p>Question: Is it possible to send the WHOLE array(that is all the values that the array contains) using getters and setters to another class?</p>
  
  <p>So me Example and problem:</p>
  
  <p>Let's say in one class I have:</p>
  
  <pre><code>public class(){
  private String[] array= new String[300]
  
  public String[] getArray()
  {
  return array;
  }
  
  public void setArray(String[] array)
  {
  this.array = array;
  }
  }
  </code></pre>
  
  <p>Now lets just say the array is filled with values.
  I then want to get these values in another class.</p>
  
  <pre><code>public void class2(){
  public static void main(String[] args){
          String[] array= new String[300];
          class c = new class();
          array[]=c.getArray(); //I know this is wrong I am just unsure what syntax or methods to use
  </code></pre>
  
  <p>I hope I explained my question properly.</p>
  
  <p>EDIT: okay now that the file can compile when I do use</p>
  
  <pre><code>array=c.getArray();
  </code></pre>
  
  <p>and output the array using a for loop it displays null for everything. Can someone please explain why?</p>