Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started