JAVA QUESTION 11 Consider the following method. public static int minimum(int x,
ID: 3713853 • Letter: J
Question
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
minimum(5, 4);
minimum(int 5, int 4);
minimum(int x, int y);
public static int minimum(5, 4);
Explanation / Answer
11. minimum(5, 4); 12. 3 13. int max(int x, int y) 14. Any number 15. Variables defined in a method heading (These are called formal parameters)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.