Question: JAVA QUESTION 11 Consider the following method. public static int minimum(int x, int y) { int smaller; if (x < y) smaller = x; else
JAVA
QUESTION 11
Consider the following method.
public static int minimum(int x, int y)
{
int smaller;
if (x < y)
smaller = x;
else
smaller = y;
return smaller;
}
Which of the following is a valid java statement which calls this method?
| minimum(5, 4); | ||
| minimum(int 5, int 4); | ||
| minimum(int x, int y); | ||
| public static int minimum(5, 4); |
1 points
QUESTION 12
Consider the following method.
public static int minimum(int x, int y)
{
int smaller;
if (x < y)
smaller = x;
else
smaller = y;
return smaller;
}
What is the value of s after the following statement executes?
int s = minimum(5, minimum(3, 7));
| 3 | ||
| 5 | ||
| 7 | ||
| None of these |
1 points
QUESTION 13
Given the method heading
int larger(int x, int y)
which of the following does NOT demonstrate method overloading?
| int larger(int x, int y, int z) | ||
| int larger(char x) | ||
| int max(int x, int y) | ||
| double larger(double x, double y) |
1 points
QUESTION 14
How many constructors can a class have?
| 0 | ||
| 1 | ||
| 2 | ||
| Any number |
1 points
QUESTION 15
Which of the following is NOT an actual parameter?
| Expressions used in a method call | ||
| Variables used in a method call | ||
| Variables defined in a method heading | ||
| Constant values used in a method call |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
