Question: Please answer the question in relation to the afformentioned code segment. This is in reference to a JAVA program. Consider the following class declaration: public

 Please answer the question in relation to the afformentioned code segment.

Please answer the question in relation to the afformentioned code segment. This is in reference to a JAVA program.

Consider the following class declaration: public class SomeClass { private int num; public SomeClass(int n) { num = n; ) Which of the following expressions evaluates to "true after the code executes. public void setToZero () { num = 0; A. I only I II ) one == two two == three one three B. Il only { public int getNum () return num; ) C. lll only } D. I and 11 E. I, II, and III SomeClass one = new SomeClass (7); SomeClass two = new SomeClass (8); SomeClass three = two; one.setToZero(); two.setToZero(); System.out.println(one.getNum() + " " + two.getNum() + - " + three.getNum()); What is printed as a result of executing the code segment? 1. 788 2.088 3. 008 4. 000 5. 007

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!