go to previous page   go to home page   go to next page highlighting

Answer:

public static double min( double a, double b)


Overloading

There are four versions of this method:

static double min(double a, double b)
Returns the smaller of two double values.

static float min(float a, float b)
Returns the smaller of two float values.

static int min(int a, int b)
Returns the smaller of two int values.

static long min(long a, long b)
Returns the smaller of two long values.

When two or more methods have the same name but different parameter lists, the methods are said to be overloaded. In the above, each method has a different parameter list.

If a program uses min(), the compiler will pick the correct version based on the parameters.


QUESTION 26:

Do you suspect there is a max() method?


go to previous page   go to home page   go to next page