Created
March 20, 2015 17:29
-
-
Save ecornell/7473232babefad8f61de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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