Arrays–Passing by Reference Answers

11 verified answers
2
Free Preview

What should you do when you are programming?

A
Run code on a solid-state drive.
B
Document the program.
C
Nothing.
D
Write all code down on paper.
3

What would happen during compile time if you declared a variable as int myCar and then later referred to the variable as myTruck?

A
The results would be in binary form.
B
You would receive an error message.
C
Nothing would happen.
D
myCar would turn into yourCar.
5

How are passing by value and passing by reference different?

A
The first uses a copy of the value, and the second uses a memory address.
B
The first uses a single storage, and the second uses multiple storage.
C
The first uses two Java methods, and the second uses two Java classes.
D
The first uses a memory address, and the second uses a copy of the value.
6

Which phrase defines a method that sends a copy of the value of a variable between methods?

A
passing by value
B
passing by copy
C
passing by reference
D
passing by assignment
7

Why would you choose: int trainArray[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; instead of int[] trainArray = new int[10]; when you declare an array of a certain data type and size?

A
This would never be a possibility.
B
to compile code
C
because this approach requires much less code
D
only when the code requires math
8

What is required at the end of every Java statement?

A
a period
B
a colon
C
a semicolon
D
a question mark
10

How would you classify passing by reference?

A
an oracle
B
a Boolean
C
an array
D
a method of referencing the address as a value

Did you find these answers helpful?

Arrays–Passing by Reference Answers — ASC…