| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| which one is performance wise advantageious from List,Set,Map? | | 5 |
| What is the difference between overloading and overriding a
function? | Infosys | 7 |
| What restrictions are placed on method overloading and
method overriding? | | 3 |
| What is lazy activation? | CMC | 1 |
| What are the limitations for static method? | | 3 |
| is this possible to create an array of 0 length?
if so how? if not so why?
coz we have an array in main() likw this
"static void main(String [] s) then what it signifies? | Hexaware | 2 |
| How to sort a vector elements that contains the user define
class object? (Note: If Suppose consider, A Student class
contain two data members. They are String studentName and
int rollNo. I am creating Four objects for this class, each
object contains students details like name and roll no. Now
i am storing that objects in vector and if i retiving the
elements from the vector means then it should be display in
sorting order) | ProdEx-Technologies | 2 |
| What is run time polymorphism? | Elementus-Technologies | 6 |
| which swing component is similar to rich text box in .net/vb | | 1 |
| What is UNICODE? | | 3 |
| heavy components means what? | | 4 |
| What is file class and what is its purpose? | | 1 |
| where do we use init() | | 2 |
| finalize() method? | | 4 |
| What is multiple inheritance & can we implement it in java? | Satyam | 4 |
| what is web.xml?and its use? | CTS | 6 |
| Is it possible to create Userdefined Unchecked Exception
also?If Yes, give an example? | | 2 |
| when we have to use final class in java? | | 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 |
| what are ER diagrams? | | 2 |
| |
| For more Core Java Interview Questions Click Here |