Skip to content

Instantly share code, notes, and snippets.

@ecornell
Created March 20, 2015 17:29
Show Gist options
  • Save ecornell/7473232babefad8f61de to your computer and use it in GitHub Desktop.
Save ecornell/7473232babefad8f61de to your computer and use it in GitHub Desktop.
public class Animal
{
// Create the public Field
public final static String Class = "Animal";
// Having a private field
private String foxColor;
// creating a default constructor
public Animal() {
}
// having a constructor with an argument
public Animal(String color) {
this.foxColor = color;
}
public String getfoxColor() {
return foxColor;
}
//mutator method that will control changes to a variable
public void setColor(String color) {
this.foxColor = color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment