
public class Animal {
	private String regime;

	public Animal(String reg) {
		this.regime = reg;
	}

	public void inverser() {
		if(this.regime.equals("herbivore")) {
			this.regime = "carnivore";
		}
		else if(this.regime.equals("carnivore")) {
			this.regime = "herbivore";
		}
	}

	public void afficher() {
		System.out.println(this.regime);
	}

	public String getRegime() {
		return this.regime;
	}
}
