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 are personal skills?
jok3333 [9.3K]

Answer:

Basically what you are good at

Explanation:

5 0
3 years ago
Can someone tell me how to get rid of the the orange with blue and orange on the status bar
igor_vitrenko [27]

Answer:

Explanation:

i'm not sure how tho

5 0
3 years ago
Read 2 more answers
What is an internal node?
Phantasy [73]
An internal node is a node which carries at least one child or in other words, an internal node is not a leaf node.
8 0
3 years ago
A simple way to think of the Excel application is as a giant ______.
Naddik [55]
Spreadsheet ......zzzzzz
8 0
3 years ago
Read 2 more answers
To add a glow effect to WordArt text, which of the following should be done?
g100num [7]
Number 2 is the correct answer
8 0
3 years ago
Other questions:
  • The main thing that adjusting the aperture controls when taking an image is?
    15·1 answer
  • How do you design video games
    5·1 answer
  • When the increment or decrement operator is placed before the operand (or to the operand's left), the operator is being used in
    6·1 answer
  • Whats the difference between search engine and web browser?
    6·2 answers
  • The file type ____ identifies a word 2013 document.
    11·1 answer
  • A type of Knowledge Management System is called
    5·1 answer
  • Why is it important to be part of a team in times you fail and in times you succeed?​
    15·1 answer
  • The labels on the tab buttons on the Driver tab of the Windows Device are Driver Details, Update Driver, Roll Back Driver, Unins
    12·1 answer
  • How do i make spaces in python<br> To draw hello world
    15·1 answer
  • Which browser feature will delete your history, cache, and cookies the moment you close the special window
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!