kelly, zhu

Greenhorn
+ Follow
since Jul 09, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kelly, zhu

I agree with:
----------------I only see two Strings being created, one in line 1, and another in line 3. line 2 and line 4 reference existing strings.------------------------------------
if you try:
public class Test{
public static void main(String[] args)
{
String s1,s2,s3,s4;
s1 = "Hello";
s2 = s1;
s3 = s2 + "Pal";
s4 = s3;
if(s2 == s1)
System.out.println("s1 == s2");
if(s3 == s4)
System.out.println("s3 == s4");
}
}
the result would be:
s2 == s1
s3 == s4
which means only two objects were created.
Is it still 61% to pass the exam?
Thank you!