| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| How to eliminate duplicates from an array? | Wipro | 3 |
| Difference between Application and Applet ? | Wipro | 3 |
| What are init(), start() methods and whey they are called? | | 2 |
| Consider that class classA, abstract class classB, and
final classC have been defined.Which one of the following
is correct?
1. classA extends classC implements classB
2. class A extends classB, classC
3. classA extends classB
4. classB implements classC | | 1 |
| How can be define MARKER interfce in java | | 1 |
| why java not supproting multiple inheritance?
| | 5 |
| What is Applet Flickering ? | Persistent | 1 |
| What is the use of Getters and Setters method ? | | 2 |
| String is a immutable objects . it means that string does
not change...........
But it will be chang.........
{
String s="kapil";
String s1="raj";
String s=s1;
then print(.......)
The String has been changed ..
how it is possible and why its called immutable objects | | 3 |
| what is main difference between architecture,framework and
design pattren | | 1 |
| what is ennumaration? | AMDOC | 1 |
| Can we place the any object to key attribute of
HashMap<key,value>? | HCL | 3 |
| What is the root class for all Java classes? | | 4 |
| suppose string s1="rajnish";
string s2="bhaskar";
then what will be happend ? | Fidelity | 6 |
| What are types of Java applications? | | 4 |
| 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 is the difference between abstract class and interface? | | 2 |
| what is difference betwwen hashmap and hashtable ? | Fidelity | 6 |
| what is auto boxing | UHG | 1 |
| How are this() and super() used with constructors? | | 4 |
| |
| For more Core Java Interview Questions Click Here |