title: Passing boolean argument in method but method boolean variable is still unused
body: <p>A bit of a Java noob here. So I am calling a method called <code>ageRestrProcessor()</code> that takes a boolean <code>ageValidationStatus</code> argument, into the Processing class. The Processing class has a boolean variable <code>ageNotValidated</code> already initialized to true. So now, I'm trying to pass the <code>ageNotValidated</code> variable into the <code>ageRestrProcessor()</code> method as an argument, and then within the method, trying to change the boolean value to false. But, in the method itself, it's saying the boolean variable <code>ageValidationStatus</code> is unused. So obviously that boolean value never gets changed. On the surface, it seems this should work but i can't figure out what the problem is. Thanks in advance for your responses.  </p>
  
  <pre><code>//ItemProcessors class
  
  public class ItemsProcessors {
    void ageRestrProcessor(int keyNum, String itemNameFromDB, double itemUnitPriceFromDB, boolean ageValidationStatus, boolean ageValidator, String itemUnit, Map&lt;Integer, Object[]&gt; map){
      double ageRstrItemPrice = bp.roundUpToTwoDecimals(itemUnitPriceFromDB);
      String dollarAgeRestPrice = bp.addDollarFormat(ageRstrItemPrice);
  
      if (ageValidator){
          System.out.println("\tAge Validation Successful");
          System.out.println("\tTotal Price: " + dollarAgeRestPrice);
          map.put(keyNum, new Object[] {itemNameFromDB, itemUnitPriceFromDB, itemUnit, ageRstrItemPrice, dollarAgeRestPrice});
  
          //Here, the compiler is telling me that ageNotValidated variable is never used.
          ageValidationStatus = false;
      }
      else {
          System.out.println("\tShopper is underage. Item not added");
      }
    }
  }
  
  //I'm calling the ageRestrProcessor method into this Processing class
  
  public class Processing extends OrderData {
     private Map&lt;Integer, Object[]&gt; itemMap = new HashMap&lt;Integer, Object[]&gt;();
     BasePage bp = new BasePage();
     private Exceptions xcep = new Exceptions();
     private ItemsProcessors ip = new ItemsProcessors();
     public boolean ageNotValidated = true;
  
     public void itemsProcessor(XSSFSheet itemSheet){
        if (xcep.isAgeRestricted(itemSheet, rowNum) &amp;&amp; ageNotValidated){
           String ageEntered = bp.getStringFromScanner("\tEnter DOB in 'mm-dd-yyyy' format: ");
           boolean isAgeValid = xcep.ageValidator(ageEntered);
  
           //I'm trying to pass the ageNotValidated variable into the method here.
           ip.ageRestrProcessor(keynum++, itemNameFromDB, itemUnitPriceFromDB, ageNotValidated, isAgeValid, itemUnit, itemMap);
        }
      }
  }
  </code></pre>