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
ZanzabumX [31]
3 years ago
8

1. Write a generic method that compares its 2 arguments using the equals method and returns true if they are equal and false oth

erwise. Ensure that the name of your method includes your last name.
Computers and Technology
1 answer:
Ganezh [65]3 years ago
5 0

Answer:

Explanation:

The following piece of code is written in Java. It creates the method as requested that takes in two generic objects and compares them using the .equals() built in Java method. This method will return True if the objects are identical or False if they are not. A test case is used in the code and the output can be seen in the attached image below.

   public static <T> boolean comparePerez(T a, T b) {

       return a.equals(b);

   }

You might be interested in
What is a Web application?
OLga [1]

Answer:

A web application is a computer program that utilizes web browsers and web technology to perform tasks over the Internet.

Explanation:

Web applications include online forms, shopping carts, word processors, spreadsheets, video and photo editing, file conversion e.t.c.

7 0
3 years ago
A(n)_________________printer is produce high-quality and is inexpensive *​
ziro4ka [17]

Answer:

ink jet

Explanation:

Great at producing photo quality prints and image-heavy documents, as inkjet printers do a better job of blending and producing vibrant colors than laser printers. The price of an inkjet printer is less than most laser printers.

3 0
3 years ago
In which career does the level of education vary the most?
Ksenya-84 [330]
Journalism
all the best
3 0
3 years ago
Read 2 more answers
Define a method printAll() for class PetData that prints output as follows with inputs "Fluffy", 5, and 4444. Hint: Make use of
QveST [7]

Answer:

public void printAll(){  // member function petAll()

   super.printAll();  //  calls printAll() method of the superclass (base class) AnimalData using super keyword

   System.out.print(", ID: " + idNum);} // prints the ID stored in the idNum data member of the PetData class

Explanation:

Here is the complete PetData class:

public class PetData extends AnimalData {  //

private int idNum;

public void setID(int petID) {

idNum = petID;  }

// FIXME: Add printAll() member function

/* Your solution goes here */

public void printAll(){

   super.printAll();

   System.out.print(", ID: " + idNum);}  }

PetData class is a subclass which is inherited from the base class AnimalData.

This class has a private data member which is the variable idNum which is used to store the ID value.

It has a member function setID with parameter petID which is the idNum. This method basically acts as a mutator and sets the user ID.

This class has another method printAll() that uses super keyword to access the method printAll() of the base class which is AnimalData

super basically refers to the base class objects.

Here the super keyword is used with the method name of subclass PetData in order to eliminate the confusion between the method printAll() of AnimalData and PetData since both have the same method name.

In the main() method the use is prompted to enter values for userName, UserAge and UserID. Lets say user enters Fluffy as user name, 5 as user age and 4444 as userID. Then the statement userPet.printAll(); calls printAll() method of PetData class as userPet is the object of PetData class.

When this method is called, this method calls printAll() of AnimalData class which prints the Name and Age and printAll() of PetData class prints the ID. Hence the program gives the following output:

Name: Fluffy, Age: 5, ID: 4444    

8 0
3 years ago
WILL GIVE BRAINLIST IF ANSWERED RIGHT 1. An engine's _______ contains the cylinder block, the cylinders, the piston, the connect
miss Akunina [59]
First three are c b and d
3 0
3 years ago
Read 2 more answers
Other questions:
  • What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
    10·1 answer
  • Which group of commands all appear on the Standard toolbar?
    9·2 answers
  • If a user receives a message whose tone and terminology seems intended to invoke a panic or sense of urgency, it may be a(n) ___
    13·1 answer
  • The third wave of computing was characterized by the introduction of _____.
    10·1 answer
  • A mobile device user has entered her user ID and password to access an online account. The user immediately receives a text mess
    9·1 answer
  • What term is defined as private data placed in a packet with a header containing routing information that allows the data to tra
    13·1 answer
  • List 5 anti-virus products currently in use
    15·1 answer
  • What pointer appears when pointing to a hyperlink?
    9·1 answer
  • A(n) ________ is a chart based on PivotTable data.
    15·1 answer
  • If a document is stored on a file server but team members can edit the document​ anonymously, the content on the file server is:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!