Hello, as you can see I am quite new to this site.
I would like to know, about passing by value but here is some code to help you to understand my problem:
I thought that because s1 and s2 relate to different objects, not s2 = s1; that the first statement would be false, as I am not checking for reference here!?
I know that s1.equals(s2) is true, because the value in s1 is equal to the value in s2
but the answer i got was 1 and 3.
Why is the first if statement equaling true?
thanks
Davy
p.s. the above code is taken from javaprepare sample
test 1, question 19.
trying mocks to pass my exam