Which is better arraylist or vector?
No Answer is Posted For this Question
Be the First to Post Answer
Where to store local variables?
How java is platform independent?
41 Answers College School Exams Tests, Infosys, TCS,
What is string syntax?
What restrictions are placed on method overriding?
If system.exit (0); is written at the end of the try block, will the finally block still execute?
What is Collections API?
public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod
Can we have more than one package statement in the source file?
StringBuilder s = new StringBuilder("Hello Mom");s.append(",I mean,Mother"); Response.Write(s.ToString()); String s = "Hello Mom"; s+ = ",I mean Mom"; Response.Write(s); Which is faster ? which uses the most memory?
What is the difference between access specifiers and access modifiers in java? 16
What are the different types of data structures in java?
How many objects are created when we create String class object using new operator?