hey ,
Thats wonderful clearing the concepts of references & values .
I just want to make things more clear here .
String a="Hello";
String b="HI";
String x=new String("ABC");
String y=new String("XYZ");
Can anyone please tell how many reference and how many object are there in four different expressions?
My Answer would be 4 reference variable and 2 Objects.
a,b,x,y are reference variables of Type String
And There are 2 Objects of Type String . As we have new String("ABC") and new String("XYZ");
here does these Objects have names ? or can we name them ?
-regards
Apurva
Thats wonderful clearing the concepts of references & values .
I just want to make things more clear here .
String a="Hello";
String b="HI";
String x=new String("ABC");
String y=new String("XYZ");
Can anyone please tell how many reference and how many object are there in four different expressions?
My Answer would be 4 reference variable and 2 Objects.
a,b,x,y are reference variables of Type String
And There are 2 Objects of Type String . As we have new String("ABC") and new String("XYZ");
here does these Objects have names ? or can we name them ?
-regards
Apurva