| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| i need example for java abstraction. where we use
abstraction and why we need abstraction. | Oracle | 1 |
| What is multiple inheritance & can we implement it in java? | Satyam | 4 |
| Can a for statement loop indefinitely? | | 3 |
| is java support call by reference and call by value, if
supports please explain? | | 3 |
| Explain Global variables in Packages? | | 2 |
| What classes of exceptions, thrown by a throw statement? | | 2 |
| List interface? | | 2 |
| What are batch updates. in jdbc | Corent-Technology | 2 |
| what do you meant by Runtime Polymorphism? | Persistent | 10 |
| 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 |
| AWT event listeners extends what interface? | | 1 |
| What is the life cycle of an Applet ? | | 1 |
| What do you mean by the term transient? | Ericsson | 4 |
| Name the package that always imported by default? | | 2 |
| What is the % operator? | | 2 |
| basic difference b/w ALL types of JDBC driver. | Systematix | 1 |
| what is main difference between architecture,framework and
design pattren | | 1 |
| what is the need of the Ajax? | iFlex | 5 |
| how you will prevent method overriding? | HCL | 4 |
| Can multiple catch statements be used in exceptions ? | Wipro | 4 |
| |
| For more Core Java Interview Questions Click Here |