subject

This code fragment uses arrays in java. the first line declares and allocates an array of two integers. the next two lines initialize it. (java arrays are indexed starting from 0.)

int[] a = new int[2];

a[0] = 0; a[1] = 2;

f(a[0], a[a[0]});

function f is defined as:

void f(int x, int y) {

x=1;

y=3;

}

for each of the following parameter-passing methods, say what the final values in the array a would be, after the call to f. (there may be more than one correct answer)

a. by value.

b. by reference.

c. by value-result.

d. by macro expansion.

e. by name.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:10
The head restraint should be adjusted so that it reaches a.the top of your ears b.the base of your skull c.the top of the head
Answers: 1
question
Computers and Technology, 23.06.2019 15:20
In a game with three frames, where will the objects on layer 1 appear? a. next to the play area b. in the middle of the game c. behind everything else d. in front of everything else
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Scientists have changed the model of the atom as they have gathered new evidence. one of the atomic models is shown below. what experimental evidence led to the development of this atomic model from the one before it? a few of the positive particles aimed at a gold foil seemed to bounce back. the colors of light emitted from heated atoms had very specific energies. experiments with water vapor showed that elements combine in specific proportions. cathode rays were bent in the same way whenever a magnet was brought near them.
Answers: 2
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
You know the right answer?
This code fragment uses arrays in java. the first line declares and allocates an array of two intege...
Questions
question
Mathematics, 20.11.2020 01:00
question
Mathematics, 20.11.2020 01:00