Course:: Easy-To-Follow Java Programming
Course:: Easy-To-Follow Java Programming
1. Put the different parts of a function that returns the bigger number into the
right order.
int
bigger
public static
The answers
1. Put the different parts of a function that returns the bigger number into the
right order.
9 }
2 int
6 )
3 bigger
7 {
4 (
1 public static
8 if (first > second) {
return first;
} else {
return second;
}
public static
int
bigger
(
int first, int second
)
{
if (first > second) {
return first;
} else {
return second;
}
}
An array variable is a reference variable, i.e. you store only the location of the array in
the variable.
When you call a function with an array as a parameter, only this reference or location is
copied, the original and the copied reference points to the same array. If you modify one
of the elements of the array inside the function, it modifies the element of the only array...
This only array can be referenced by "arr" inside change() and "a" inside main().