title: Method in one class can't find the variable in another
body: <p>In the class "CheckingAccount.java" I am trying to use the following:</p>
  
  <pre><code>public String accountNumber(){
      String date = Account.date;
      String name = Customer.name;
  
      String account = date + ", " + name;
      return account;
  }
  </code></pre>
  
  <p>Which makes use of a method in the class Account.java</p>
  
  <pre><code>public String date(Locale currentLocale){
      DateFormat df;
      df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, currentLocale);
      String formattedDate = df.format(getDateOpened());
  
      String date = "Opened: " + formattedDate;
  
      return date;
  }
  </code></pre>
  
  <p>and the class Customer.java</p>
  
  <pre><code>public String name(){
      String name = "Name: " + getName();
      return name;
  }
  </code></pre>
  
  <p>However, the method in CheckingAccount.java can't see Account.date or Customer.name and I'm not really sure what I am doing wrong here.</p>
  
  <p><strong>EDIT:</strong> OK, to be clear, I am NOT trying to call the method. I am trying to call the variable within the method. I also do NOT want to create new objects here. The objects will have been created in another class and will just need to be able to access the variables at that time.</p>