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
natta225 [31]
3 years ago
15

Create a class called Minimum that provides a single class method min. min should take an array of any object that implements Co

mparable and return the minimum value from the array, using compareTo to compare object instances. So the function signature of min should be public static Comparable min(Comparable[] values) As a reminder, first.compareTo(second) returns a positive value if first is larger than second, a negative value if first is smaller than second, and O if they are equal. Note that the array of Comparable references passed to min will all be the same type and contain no null references. However, the array may be null or empty in which case you should return nul1 Note that the warning about unchecked or unsafe operations is normal and not a sign that you did something wrong. We'll discuss this soon in class.) Minimum.java
Computers and Technology
1 answer:
kaheart [24]3 years ago
7 0

Answer:

The required code is given below:

Explanation:

public class Minimum {

   public static Comparable min(Comparable[] values) {

       if (values == null || values.length == 0) {

           return null;

       } else {

           Comparable minValue = values[0];

           for (int i = 0; i < values.length; i++) {

               if (values[i].compareTo(minValue) < 0) {

                   minValue = values[i];

               }

           }

           return minValue;

       }

   }

}

You might be interested in
Tab stops are very useful when you want to A. align text into rows. B. add space between paragraphs. C. align text into columns.
Alenkasestr [34]
The best answer here is Answer C - Tab stops are useful when you want to "align text into columns".

All tab stops do is shift text a fixed amount to the left or right on the line. They are useful for improving the layout of text when you want to align multiple rows.

Answer A is incorrect because rows are vertical and not horizontal. B is also irrelevant because spaces between paragraphs are vertical. Answer D could also be correct because you can use tab stops to indent text aswell, but the more general answer is A. If you can have more than one answer, you could have A and D.
8 0
3 years ago
Read 2 more answers
Opinion on sandshrew​
Alex

Answer:Sandshrew is cute

Explanation:

3 0
2 years ago
What was the first 1.0.1 version of openssl that was not vulnerable to heartbleed?
vovikov84 [41]
I suggest you to read OpenSSL changelogs to make it more clear. As there's not enough space to describe how it works. But heartbleed resistan version was 1.0.2, as I know.
5 0
2 years ago
Read 2 more answers
In GIMP, the ( ) displays the image that the user is currently working on
kotykmax [81]
I don'r know what your trying to use? GIMP is a free photo editing software just upload it to photobucket.
7 0
3 years ago
If you receive an email message you suspect is spam, what should you do?
Alla [95]

Answer:

A.  delete the message without opening it.

Explanation:

Never open emails you don't know who sent it, it could be a hacker trying to get your personal/financial information.

6 0
3 years ago
Other questions:
  • Explain why blocking ping (ICMP echo request) packets at an organization's edge router is not an effective defense against ping
    11·1 answer
  • You type. The word "weather" when you ment "whether" when will the writer or word flag this as a misspelling or a grammar proble
    13·1 answer
  • How can you put a logo on html without breaching the copyright, design and patents act
    12·1 answer
  • Kiera is building a new computer and wants to make sure she has an adequate power supply for all the new equipment she is purcha
    15·2 answers
  • Write a program in python to test if given number is prime or not.
    6·2 answers
  • Give a detailed example of how an app (that you use regularly)uses parameters. You must state the app's name and function, the p
    7·1 answer
  • How do you write a multiplication formula in excel with an absolute refrence?
    11·1 answer
  • SOMEONE PLEASE HELP ME OUT WITH THIS!!!!!!
    12·2 answers
  • PLEASE HELP ASAP!! Timed test!!
    12·1 answer
  • open your browser and enter the address of this ftp site in the address box: ftp.cengage. if your browser supports ftp, a logon
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!