Hello all...
This is from RHE Mock
Test.
How many Objects r created in below Prog ?
StringBuffer sb1 = new StringBuffer("Hello");
StringBuffer sb2 = sb1;
StringBuffer sb3 = new StringBuffer("Hello");
According to the mock test, the answer was 3 Objects.
The reason:- 2 Stringbuffer Objects & 1
String Literal.
But i think it is 2 Objects.
Can someone explain me if i m wrong?
Also in the same mock there was a question on valid int literal
the Example given was:-
int i = 3, int j = &simi;
What does &simi means?
Thanks.