1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SVEN [57.7K]
3 years ago
5

We need an equals method for the Dog class. It needs to give back to the caller a boolean value indicating whether another objec

t of the same type's attributes are all of the same value as the calling object's. Provide the entire method (header and code), and only the method.
public class Dog {
private String name;
private int age;
private int [] healthScores;
}
Computers and Technology
1 answer:
Nadusha1986 [10]3 years ago
3 0

Answer and Explanation:

Using Javascript:

Class Dog{

var healthScores=[];

Constructor(name, age, ...healthScores) {this.name=name;

this.age=age;

this.healthsScores=healthScores;

}

checkObject(new Dog){

If(new Dog.name===this.name,new Dog.age===this.age, new Dog.healthScores===this.healthScores){return true;

}

else{

console.log("objects are not equal");

}

}

}

To call the method checkObject:

var Tesa = new Dog(Tes,1,[45,46,82]);

var Bingo = new Dog(bing,2,[43,46,82]);

Bingo.checkObject(Tesa);

Note: we have used ES6(latest version of Javascript) where we passed the healthScore parameter(which is an array) to our constructor using the spread operator.

You might be interested in
The next thing Maia wants to do is to indent the first line of her paragraphs.
mr_godi [17]

Answer:

she can indent the first line of her paragraph by clicking on the space bar a series of time.

3 0
3 years ago
Read 2 more answers
Which was the first wiki based website
stira [4]
WikiWikiWeb was the first made by <span>Cunningham.</span>
5 0
3 years ago
Read 2 more answers
taking small bits of information from the internet/web and using it as my own work or to complete an assignment is plagiarism.
lana66690 [7]
Not necessarily, if you are sourcing the information you have used to come to your own conclusion then that isn't plagiarism, however if you just copy paste completely and use it as your own work then yes it is plagiarism.  <span />
7 0
3 years ago
Every program that is created will have a starting point called ___________and is the beginning of execution.
pashok25 [27]

Answer:

Compute I think

Explanation:

I'm not 100% sure

4 0
3 years ago
A person who creates a computer virus is a (1)system analyst (2) techician(3) programmer​
mars1129 [50]

Answer:

a person who creates a computer virus is a programmer

8 0
3 years ago
Read 2 more answers
Other questions:
  • A __________ network is good for connecting computer clusters.
    13·2 answers
  • data structureWe have two containers: one has a capacity of three gallons of water, the other five gallons. Both are initially e
    11·1 answer
  • Write a program which reads in a single integer 0 &lt;= n &lt; 30 and prints out the factorial of n. Factorials get very big ver
    9·2 answers
  • What are the disadvantages of plasma display?
    9·1 answer
  • Direct Mapped Cache. Memory is byte addressable. Fill in the missing fields based upon the properties of a direct-mapped cache.
    6·1 answer
  • 18. When you turn off the power to a computer and unplug it at night, it loses the date, and you must reenter it each morning. W
    7·2 answers
  • 4. A computer architect boasted that they were able to design a computer in which every instruction occupied exactly thirty-two
    8·1 answer
  • The first synthesizers were small simple machines that were easy to use. a. true b. false
    12·1 answer
  • i was wondering if anybody would have a season 1 or 2 or 3 Fortnight account they never use and was gonna ask if i could play on
    13·1 answer
  • Which of the following factors is least likely to result in delivery delays?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!