| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Is 'sizeof' a keyword? | | 3 |
| what ide u r using and wat version, how wil u build the
project etc ? | | 2 |
| What is an abstract class? | Wipro | 5 |
| Differentiate Vector and ArrayList? | Wipro | 3 |
| what is the difference between AWT and SWING what is the
advantage of using swing? | | 2 |
| Explain Connection Pooling? | | 2 |
| what is difference betwwen hashmap and hashtable ? | Fidelity | 5 |
| What is the immediate superclass of Menu? | | 1 |
| can any one tell me when do u go for inheritance and
polymorphism | | 1 |
| Is java supports multiple inheritance? explain? | Inforica | 9 |
| What is unicode? | | 2 |
| write a simple program inheritance? | Polaris | 1 |
| can you program for reverse string? | IBM | 4 |
| What is I/O Filter? | TCS | 1 |
| What are the Object and Class that classes used for? | | 2 |
| When you Click a Button, What event will be fired? | | 1 |
| What is the purpose of finalization? | | 3 |
| what is difference between abstraction and interface?
| FIC | 5 |
| what is difference between servletconfig and servletcontext? | AMDOC | 2 |
| 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
| TCS | 3 |
| |
| For more Core Java Interview Questions Click Here |