Ant.java - \/CSE 142 Critter\/Authors XINCHAO XU\/Ant objects are red and represented as and always\/scratch duing fighting import java.awt public class Ant

Ant.java - /CSE 142 Critter/Authors XINCHAO XU/Ant...

This preview shows page 1 out of 1 page.

//CSE 142 Critter//Authors: XINCHAO XU////Ant objects are red and represented as % and always //scratch duing fighting.import java.awt.*;public class Ant extends Critter {private boolean walkSouth;private int steps = 0;public Ant(boolean walkSouth) {this.walkSouth = walkSouth;}//colorpublic Color getColor() {return Color.RED;}//eating behaviorpublic boolean eat() {return true;} //fighting behavior

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture