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
A farmer sells tomatoes. For some reason, the farm obeys mechanical laws of fate.
Mars2501 [29]

Answer:

Here are the if/elif statements:

if tomatoes == 24:  #if farmer sells exactly two dozen tomatoes

   watermelons +=4  #farmer receives 4 watermelons

elif tomatoes >= 12:  #else farmer sells at least a dozen tomatoes

   watermelons +=2  #farmer receives 2 watermelons

else:

   tomatoes<12   #On the days that farmer sells less than a dozen tomatoes

   apples +=1  #farmer will get a single apple

Explanation:

You can test the working of these if elif statements by this program:

tomatoes = int(input("Enter the amount of tomatoes sold: "))  #prompts user to enter number of tomatoes

watermelons = 0  #initialize watermelons value to 1

apples = 0  #initialize apples value to 1

if tomatoes == 24:

   watermelons +=4

elif tomatoes >= 12:

   watermelons +=2

else:  

   tomatoes<12

   apples +=1

   

print("Number of watermelons recieved: ",watermelons)  #displays the received number of watermelons

print("Number of apples recieved: ",apples )  #displays the received number of apples

8 0
3 years ago
Privacy settings allow account owners to decide who can ........
schepotkina [342]
Have access to your phone info
4 0
3 years ago
Read 2 more answers
How do I cancel a friend request?
dusya [7]

Answer:

By pushing cancel

Explanation:

It's simple

3 0
3 years ago
Read 2 more answers
A mouse is known as a _____ device that is able to detect motion in relation to the surface and provides an onscreen pointer rep
hichkok12 [17]
I think the answer is C because u can control the computer with a mouse to point at stuff on screen and also click on things with it its the main device u use besides key pad but without mouse u cant really do anything so i would pick C
3 0
3 years ago
Plzzz help i need this today :(
Juliette [100K]

Answer:

C

Explanation:

8 0
3 years ago
Other questions:
  • This provides an easy method for workers to use their computers.
    5·1 answer
  • What is the keyboard command that allows you to copy text
    12·2 answers
  • The work principle is not always true<br> T or F
    11·2 answers
  • Which of the following is a new feature in Windows Server 2016 that enables block-level data replication to occur automatically
    5·1 answer
  • What is a computer?
    9·2 answers
  • Guys please join this link... I want friends...
    7·2 answers
  • You are managing an FTP server installed in Ubuntu Server. The server has created a very large log le, vsftpd.log. Which command
    14·1 answer
  • Which shortcut key combination will move the cursor to the beginning of the line?
    13·1 answer
  • Briefly describe the fundamental differences between project-based and product-based Software Engineering.
    10·1 answer
  • You are designing an ecommerce web application that will scale to hundreds of thousands of concurrent users. Which database tech
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!