title: Java - Using variable from another class as method argument
body: <p>In my <code>Main</code> class I have this piece of code:</p>
  
  <pre><code>UUID uniqueID;
  
  public void createEmployee(){       
      uniqueID = UUID.randomUUID(); 
      // ...
  }
  </code></pre>
  
  <p>In my class <code>Corporation</code> there's a method called <code>promoteEmployee</code>, which should receive the uniqueID as parameter. Is that possible, and when yes, how?</p>
  
  <pre><code>public void promoteEmployee(uniqueID){
     // it doesn't recognize uniqueID as argument
  }
  </code></pre>
  
  <hr>
  
  <p>I also have the method <code>sortEmployees</code>, which sorts the ArrayList alphabetically, and if two names are equal, the employee with a higher salary should be printed out first. It sorts the List alphabetically, but doesn't check if the salary is bigger. What do I need to change?</p>
  
  <pre><code>ArrayList&lt;Employee&gt; employees = new ArrayList&lt;Employee&gt;(); 
  
  public void sortEmployees(){
      Collections.sort(employees, (p1, p2) -&gt; p1.name.compareTo(p2.name));
      for(Employee employee: employees){
          Comparator.comparing(object -&gt; employee.name).thenComparingDouble(object -&gt; employee.grossSalary);
          System.out.println("ID: " + employee.ID + END_OF_LINE + "Name: "+employee.name + END_OF_LINE + "Salary: " + employee.grossSalary);
          System.out.println(""); // just an empty line
      }
  }
  </code></pre>