Question: I'm pretty close on the coding but nothing is showing on my output for my Eclipse application please advise. /Java class Pet public class Pet

I'm pretty close on the coding but nothing is showing on my output for my Eclipse application please advise.

/Java class Pet public class Pet { public static void main(String args[]) { } //private member variables public String name; public int age; public String species; public double weight; //public methods to access and change the values of these variables public void setName(String name) { this.name=name;//set name } public String getName() { return this.name;//return name } public void setSpecies(String species) { this.species=species;//set species } public String getSpecies() { return this.species;//return species } public void setAge(int age) { this.age=age;//set age } public int getAge() { return this.age;//return age } public void setWeight(double weight) { this.weight=weight;//set weight } public double getWeight() { return this.weight;//return weight } //display() method public String display() { //return string return "A "+this.age+" year old "+this.species+" named "+this.name+" that weighs "+this.weight+" pounds."; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!