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
How do I convert years to days on Python. For example, if I were to enter 3 years it should output "You are 1095 days old".
Scorpion4ik [409]

years = int(input("Enter the # of years: "))

print("You are "+str(years*365)+" days old")

I wrote the code in python 3.8. I hope this helps!

6 0
2 years ago
Corona and app inventor can be used to develop ________.
Sidana [21]
<span>Corona and app inventor can be used to develop apps for smartphones. Corona can be used to build both games and apps from major platforms like iOS, Android, Kindle, Apple TV, Android TV, macOS, and Windows. App Inventor was originally provided by Google and is now maintained by MIT.</span>
3 0
3 years ago
Select each procedure that will keep the computer safe and working properly. the correct answers are A, D, E
Mekhanik [1.2K]
Yes uo daddddy deff uuxk me. har we. dd dads aafddu
6 0
2 years ago
The PadRight function has two parameters: S (a string) and N (an int), and returns as its result the string S padded on the righ
oee [108]

Answer:

The following code is written in python programming language:

def PadRight(S,N):   #define user defined function

 if(len(S)<N):    # set if condition

   S=S.ljust(N)   #set the space to right

   return S       # return the result

 

def PadLeft(S,N):    #define user defined function

 if(len(S)<N):    # set if condition

   S=S.rjust(N)   # set the space to left

   return S       # return the result

'''calling the function'''

print(PadLeft("Frog",7))

print(PadRight("Frog",7))

Output:

      Frog

Frog

Explanation:

Here, we define a user defined function "PadRight()" and pass two arguments in its parameter "S", "N".

Then, set the if condition and pass condition "len(S)<N" then, if the condition is true then the code inside the if condition set the space to right then, return the output.

After that, we again define a user defined function "PadLeft()" and pass two arguments in its parameter "S", "N".

Then, set the if condition and pass condition "len(S)<N" then, if the condition is true then the code inside the if condition set the space to right then, return the output.

6 0
3 years ago
When you need to switch on an electrical current at a remote location, would you use a relay or an amplifier?
ahrayia [7]

Answer:

Relay

Explanation:

They both perform similar functions in terms of control of voltage and current but the relay would be better because although it cannot produce a variable output like that of an amplifier, it has the capacity to isolate its input from its output.

7 0
2 years ago
Other questions:
  • What piece of software tells the operating system how to use a specific hardware device?
    14·1 answer
  • The ____ preceding a formula alerts excel that you are entering a formula or function and not text
    14·1 answer
  • The mobile nodes (devices) add or leave a Mobile Ad-hoc Network, changing the _____ of this network over time. a) infrastructure
    14·1 answer
  • Use the Law of Sines to solve the triangle. Round your answers to two decimal places.
    6·1 answer
  • Which of the following statements is true?A)Implicit data type conversion is performed when you mix values of different data typ
    5·1 answer
  • Prove that the dual of the exclusive-OR gate is also itscomplement
    10·1 answer
  • What tab should you choose if you want to practice presenting with your PowerPoint slides?
    5·2 answers
  • how do I delete my brainly account, my child signed up for it and nothing has been paid but I do not want the account to exist a
    7·2 answers
  • Time shifting occurs when
    8·2 answers
  • Write a SQL query to display films in inventory that have never been rented for all stores. Include inventory ID, film ID, film
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!