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
Mark and his team are working on a project that is due for delivery in the next few days. The team is using project management t
meriva

Answer:

The correct option is;

B. Managing change

Explanation:

Change management is a process of applying methods and instruments that bring about the implementation of required changes in an organization or project such that the changes are carried out in a seamless and timely manner using a carefully laid out and thorough approach that reduces the impact of the change on the quality of service and that handles the disruptions in the project or organization brought about by the change

7 0
2 years ago
Which command would you use to move a file from one location to another?
Ksivusya [100]
On Windows, if you use CMD, there is a command called 'move' and using a Linux terminal, it's 'mv'
7 0
3 years ago
Read 2 more answers
Group of programs are software ​
Cloud [144]

Answer:

No

Explanation:

a single program or application is a software

3 0
2 years ago
Read 2 more answers
What is a device that connects to the system unit and is controlled by the processor in the computer called !
Airida [17]
Most computers have three types of ports: serial, parallel, and USB. A serial port is a type of interface that connects a device to the system unit by transmitting data only one bit at a time. Serial ports usually connect devices that do not require fast data transmission rates, such as a mouse, keyboard, or modem.
4 0
3 years ago
NEED HELP 100 POINTS FOR ANSWER AND BRAINIEST!!! Which comparison operator is used to signify that a value is not equal to anoth
katrin2010 [14]

Answer:

We use SQL Not Equal comparison operator (<>) to compare two expressions. For example, 10<>11 comparison operation uses SQL Not Equal operator (<>) between two expressions 10 and 11

Explanation:

8 0
2 years ago
Read 2 more answers
Other questions:
  • Which of the following is NOT an example of input?
    8·1 answer
  • Are there protections for people in terms of what data can be collected by different sites?
    10·1 answer
  • . char values are surrounded by _____ quotes
    15·1 answer
  • The lightbulb transfers electricity energy into light what is one type of energy that is also generated that is not a desired af
    14·1 answer
  • How do you recognize the brand name of a drug in the package insert?
    15·1 answer
  • What is the best operating system
    12·1 answer
  • X = 19 y = 5 print (x % y)
    11·1 answer
  • 6 external parts of computer
    10·2 answers
  • Given an initialized variable fileName, write a sequence of statements that create a file whose name is given by the variable an
    15·1 answer
  • Select the correct answer. Which step references adding color, size, and media format in your digital portfolio? A. identifying
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!