| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is mean by overriding in which situation we wil use? | Atlas-Systems | 4 |
| what is request dispatcher and how does it work? | CTS | 1 |
| What is the difference between the >> and >>> operators? | | 1 |
| 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 |
| what are the purposes of native, transiant key words? | | 2 |
| Explain about vector, dictionary,hash table, property
classes? | Patni | 1 |
| Can we access private data outside of the class directly in
java programming language? Why There is no runtime checking
in java, which leads to access the private data directly
outside of a class? | Google | 1 |
| What is the return type of a program?s main() method? | | 2 |
| What are field variable and local variable? | | 2 |
| What is the difference between serialization and
deserialization? | | 2 |
| where u use Abstraction and Interface in real time | Sonata | 2 |
| What is "finally" keyword? | | 3 |
| Which containers use a FlowLayout as their default layout? | | 3 |
| Life Cycle of Thread | IBM | 2 |
| Explain Public static void main? | | 2 |
| What happens if an exception is not caught? | | 4 |
| Explain the difference between the Boolean & operator and
the && operator? | | 1 |
| What is the purpose of finalization? | | 3 |
| How are commas used in the initialization and iteration
parts of a for statement? | | 2 |
| What is the default initialized value of a boolean type
variable? | | 3 |
| |
| For more Core Java Interview Questions Click Here |