Issue with "non static method cannot be referenced from a static context" error
<p>I am having an issue with this error, while trying to write a method that lists all names in a specific class. (error at bottom) I have tried a few things but for the life of me, cannot figure it out. Please help, thanks.</p>

<p>Class Cat:</p>

<pre><code>public class Cat
{
// instance variables 
private String name;
private int yearOfBirth;
private int weightInKilos;

public Cat() {
   setName("");
   setYearOfBirth(0);
   setWeightInKilos(0);
}

/**
 *  
 */
public Cat(String newName, int newYearOfBirth, int newWieghtInKilos )
{
    setName(newName);
    setYearOfBirth(newYearOfBirth);
    setWeightInKilos(newWieghtInKilos); 
}


public String getName(){
    return name;
}

public int getYearOfBirth(){
    return yearOfBirth;
}

public int getWieghtInKilos(){
    return weightInKilos;
}



public void setName(String newName){
    if (newName != null ){
    name = newName;
    }
    else{
        System.out.println("Invalid Name");
    }

}

public void setYearOfBirth(int newYearOfBirth){
    if (yearOfBirth &gt;= 0){
    yearOfBirth = newYearOfBirth;
    }
    else{
        System.out.println("Year Of Birth must not be negative!");
    }
}

public void setWeightInKilos(int newWeightInKilos){
    if (weightInKilos &gt;= 0){
    weightInKilos = newWeightInKilos;
    }
    else{
        System.out.println("Weight must not be negative!");
    }

}

}
</code></pre>

<p>Class Cattery:</p>

<pre><code>import java.util.ArrayList;


public class Cattery
{
// instance variables - replace the example below with your own
private ArrayList &lt;Cat&gt; cats;
private String businessName;

/**
 * Constructor for objects of class Cattery
 */
public Cattery(String NewBusinessName)
{
    cats = new ArrayList &lt;Cat&gt;();
    NewBusinessName = businessName;
}

public void addCat(Cat newCat){

    cats.add(newCat);
}

public void indexDisplay(int index) {
    if((index &gt;= 0) &amp;&amp; (index &lt;= cats.size()-1)) {
        System.out.println(index);
    }
    else{
        System.out.println("Invalid index position!");
    }
}

public void removeCat(int indexremove){
     if((indexremove &gt;= 0) &amp;&amp; (indexremove &lt;= cats.size()-1)) {
         cats.remove(indexremove);
        }
    else{
        System.out.println("Invalid index position!");
    }
}

public void displayNames(){
   System.out.println("The current guests in Puss in Boots Cattery:");
   for(Cat catNames : cats ){
       System.out.println(Cat.getName());   //ERROR; non static method cannot be referenced from a                  static context..wtf

}
}
}
</code></pre>

<p>Please help, thanks</p>
