11
answers
0
watching
409
views
30 Apr 2018

2. In this section you will be shown several classes. Inside the code for each class will be a question. You should provide your answer to the question inside the chart. Many of the questions will ask you whether a variable has changed or not. In cases that the variable being asked about is a primitive type, you should provide your answer based on the data stored in the primitive type. In cases that the variable being asked about is a reference type, you should provide your answer based on the data stored at the Object linked to by the reference type. For example, in the first snippet, the question asks about the variable x defined in the main method. Since x is a primitive type, you should answer YES if you think the variable x has had its value changed after the method methodOne() returns. All your answers should go in the chart below: (9 points) Part Answer to question x changed (circle one)? YES NO y changed (circle one)? a changed (circle one)? b changed (circle one)? d1 a changed (circle one)? b changed (circle one)? YES e words changed (circle one)? YES NO Values in array of array referred to by y: What is printed to the screen? (a) public class ReferenceTesti public static void methodOne (int x){ x++; public static void main(String[args) { int x = 0; methodOne (x); //IS THE DATA STORED OR REFERRED TO BY X THE SAME? (ANSWER IN CHART)

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Patrina Schowalter
Patrina SchowalterLv2
1 May 2018
Already have an account? Log in

Related questions

Related Documents

Weekly leaderboard

Start filling in the gaps now
Log in