Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions