Nelianjackhx Nelianjackhx
  • 07-11-2016
  • Computers and Technology
contestada

Write the definition of a method min that has two int parameters and returns the smaller.

Respuesta :

kingburrito
kingburrito kingburrito
  • 07-11-2016
public class ExampleMinNumber {
     public static void main(String[] args) {
          
int a = 11;
         
int b = 6;
          int c = minFunction(a, b);
     System.out.println("Minimum Value = " + c);
}

/** returns the minimum of two numbers */
public static int minFunction(int n1, int n2) {
    
int min;
    
if (n1 > n2)
       
min = n2;
    else 
       min = n1;
  return min;
   }
}
java 8.0
Answer Link

Otras preguntas

What are examples of water on Earth that are part of the water cycle
What are the Answers to 1-10?
Explain how imperialism contributed to the outbreak of ww1.
International Women’s Day Vocabulary Feminist: Sex vs. gender: Sexism: Sexual harassment: Sexual assault: Stereotype: Patriarchy: Pink tax: Intersectionality: M
help me plssssss!!!!!!
Without multiplying, pick whether each product is greater than, less than or equal to the whole number. 4 x 1/7
5(3x + 9) -2x = 15x-2(x-5)
A parabola is given in the diagram below. What are the coordinates of the vertex and the equation of the axis of symmetry?
Hitler's racism was developed from the views ofa) Charles Darwinb) Herbert Spencerc) John Locked) Both (a) and (b)​
What made immigrants Jacob Riis famous in the late nineteenth century?