Question: Need help with this Strings/Methods question! N class Dinosaur( private int height; // The height of a dinosaur in feet private int weight; // The
Need help with this Strings/Methods question!
N

class Dinosaur( private int height; // The height of a dinosaur in feet private int weight; // The weight of a dinosaur in pounds private String color; //The color of the dinosaur public Dinosaur (int height, int weight, String color)( this.height - height; this.weight - weight; this.color - color; public Dinosaur (String color)( this. color = color; this.height - 0; this.weight - 0; public void eat(int mass) if(isNegative(mass)) return; this.weight +- mass; public void grow(int amount)H if (isNegative(amount)) return; this.height +- amount; private boolean isNegative(int value)I if (value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
