| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Write a program to create a binary Tree ? | | 1 |
| what is the use of abstract class and interface with example? | DNS | 2 |
| how to connect one jsp page to another jsp page???? | Symphony | 4 |
| What is difference between static method and static
variable? | | 6 |
| Can an unreachable object become reachable again? | | 3 |
| What are Encapsulation, Polymorphism and Inheritance? | | 2 |
| What are the Object and Class that classes used for? | | 3 |
| define System.out.println(); what is the meaning! | | 8 |
| What is deadlock and how to avoid this? | | 2 |
| Can Applet have constructors? | | 3 |
| what is web.xml?and its use? | CTS | 6 |
| What JNDI(Java Naming and Directory Interface) provides? | | 4 |
| What is meant by controls and types? | | 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 |
| why java not supproting multiple inheritance?
| | 5 |
| which methods consisting of the serilizable interface? | | 3 |
| What is the difference between a public and a non-public
class? | | 2 |
| How to validate the request (Eg:user name and password) in
session(http session)? not in LDAP server ? | Saksoft | 1 |
| How the threads are synchronized? | BMC | 2 |
| what is an object and how do you allocate memory to it? | Wipro | 3 |
| |
| For more Core Java Interview Questions Click Here |