title: Java - parameters 'cannot be resolved to a variable' error
body: <p>I'm having this problem with my code, and I know it has to deal with scope, but I've been looking over it for a long time and I can't seem to find the fix. Any help would be greatly appreciated. It seems as though all the errors deal with the parameters I have set in my first class "Stock."</p>
  
  <p>Here is the error:</p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
  
      close cannot be resolved to a variable,
      price cannot be resolved to a variable,
      change cannot be resolved to a variable,
      close cannot be resolved to a variable,
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>public class Stock
  {
     String Symbol;
     String Name;
     double previousClosingPrice;
     double currentPrice;
  
     Stock(String s, String n, double previousClosingPrice, double currentPrice)
     {
        Symbol = s;
        Name = n;
     }
     public String getName() { 
        return Name; }
  
     public String getSymbol() { 
        return Symbol; }
  
     public double setClosingPrice(double close)
     {
        previousClosingPrice = close;
        return close;
     }
  
     public double currentPrice(double price)
     {
        currentPrice = price;
        return price;
     }
  
     public double getChangePercent(double change)
     {
        change = (currentPrice - previousClosingPrice) / currentPrice * 100;
        return change;
     }
  
     public String toString()
     {
        System.out.println(Name + " stock closing price is $" + setCurrentPrice(price));
     }
  }
  
  
  public class Test_Stock
  {
     public static void main(String[] args)
     {
  
        Stock s1 = new Stock("GOG", "Google", 134.67, 131.98);
        Stock s2 = new Stock("MSF", "Microsoft", 156.52, 161.22);
  
  
        System.out.println("Google stock: ");
        System.out.println("    Symbol: " + s1.getSymbol());
        System.out.println("    Closing price: " + s1.setClosingPrice(close));
        System.out.println("    Current price: " + s1.setCurrentPrice(price));
        System.out.println("    Change percent: " + s1.getChangePercent(change));
        s1.toString();
  
        System.out.println("Google stock: ");
        System.out.println("    Symbol: " + s2.getSymbol());
        System.out.println("    Closing price: " + s2.setClosingPrice(close));
        System.out.println("    Current price: " + s2.setCurrentPrice(price));
        System.out.println("    Change percent: " + s2.getChangePercent(change));
        s2.toString();
     }
  
  }
  </code></pre>