title: Get and Set methods in another classes
body: <p>Im learning java and I have problem with get and set methods in other classes.</p>
  
  <p>My first class is named Department and second is named Company. I would like to set number of staff in class Department and get number of staff in class Company.</p>
  
  <p>Department class</p>
  
  <pre><code>public class Department {
  
      public int staffNumber;
  
      public Department() {
      }
  
      public void setStaffNumber(int staff) {
          this.staffNumber= staff;
      }
  
  }
  </code></pre>
  
  <p>Company class</p>
  
  <pre><code>public class Company {
  
       public Department staffNumber;
  
       public Company() {
       }
  
       public Department getStaffNumber() {
            return Department.staffNumber = Department.staffNumber;
       }
  
  }
  </code></pre>
  
  <p>Can you please help me with error message - non-static variable staffNumber cannot be referenced from a static context ? 
  Thank you</p>