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
What is a hobbyist for engineering
Nimfa-mama [501]
I believe its when some one does engineering as a hobby.
3 0
3 years ago
Plagiarism is when you try to pass of someone else's words as your own. What else does it include? Select all that apply. Please
Andreyy89
All of the above, except images
3 0
4 years ago
Which of the following is not an acceptable way to code a nested structure? Select one: a. nest a for loop inside a while loop b
kirill115 [55]

Answer:

nest an else clause within an elif clause

Explanation:

in python Programming, we cannot nest an else clause within an elif clause. elif is actually else if condition. we cannot nest another else with in elif clause.

8 0
3 years ago
What is the value of the variable result after these lines of code are executed?
Marta_Voda [28]

Answer:

W

Explanation:

W

3 0
3 years ago
Read 2 more answers
Plz plz plz subsribe to my channel, CookieFunTime
Nesterboy [21]

ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok

7 0
3 years ago
Other questions:
  • If you decide to get married, a trade-off would be that you have to give up being single.
    12·2 answers
  • A peer-to-peer (p2p) network is an example of ________ administration
    5·1 answer
  • A technician suspects a network card is not working. Which tool should the technician use to test the network card?
    8·1 answer
  • What is the correct term for a set of established guidelines for actions (which may be designated by individuals, teams, functio
    13·1 answer
  • Where do you get your news? Is it owned by a large conglomerate does it matter to you who own your local news outlets? why or wh
    5·1 answer
  • Explain why an organization's firewall should block outgoing packets the source addresses of which are not in the organization's
    10·1 answer
  • Which of the following statements best represents the impact vaudeville had on the film industry? Early silent films were more r
    14·1 answer
  • An online bank wants you to create a program that shows prospective customers how their deposits will grow. Your program should
    13·1 answer
  • What is the recipe for enchanting table?
    14·2 answers
  • PA theme is a major message that a writer convoys through a text. you have explored many themes in the hobbit one theme in the n
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!