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]
2 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]2 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
While working on a group project, you notice something does not look right in the presentation. You call a meeting with your tea
hodyreva [135]
<span>While working on a group project, you notice something does not look right in the presentation. You call a meeting with your team. At the meeting, everyone works together to identify what is missing, define what needs to be done, and assign tasks. 

What is this called? 

Conflict resolution 
Negotiation 
Problem-solving 
Verbal communication

The Answer As You Thought Is Verbal Communication
Because You Are talking verbaly To You're Partners 

Hope I Helped
:D


-Nullgaming650</span>
7 0
3 years ago
Read 2 more answers
Strobe lights can become more yellow as they age true or false
guajiro [1.7K]
False they can have a yellow setting but the light is always white

6 0
3 years ago
Which director has shot a movie in HD? George Lucas, Michael Mann, Michael Moore, none of the above, all of the above
levacccp [35]

This answer is All of the above.

8 0
3 years ago
If you have machines doing jobs, fewer staff are needed, therefore costs are
elena55 [62]
If you have machines doing jobs, fewer staff is needed, therefore the costs are LESS.

Hope I helped!
4 0
3 years ago
Read 2 more answers
How many fonts are there in a theme?<br> A. 1<br> B. 2<br> C. 4<br> D. 5
BlackZzzverrR [31]

B. 2

If incorrect, sorry

6 0
3 years ago
Other questions:
  • Which of the following is not a commodity?<br>A. Crude oil<br>B. Corn dogs<br>C. Cocoa<br>D. Coffee​
    10·2 answers
  • What allows a person to interact with web browser software?
    13·2 answers
  • 0x400C (in hexadecimal)?
    8·1 answer
  • During prereading, it is not important to pay attention to visual aids.<br> T f
    15·2 answers
  • (5 points) Create a user-defined data structure (i.e., struct) called Point that represents a two-dimensional Cartesian coordina
    5·1 answer
  • Beyond adding equations, what else does the Insert Equation feature allow users to do?
    7·1 answer
  • Anyone down to play gta later i play on ps4?
    15·2 answers
  • What is a fire wall and how does it work
    6·1 answer
  • How do I install another part on campaign call of duty cold war? please help.(best answer will get branliest.)
    15·2 answers
  • A slide titled Alexander Graham Bell. There are 6 bulleted entries on the slide, and there is a lot of text on the slide. There
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!