| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is a void return type? | | 2 |
| Which class is the immediate superclass of the Container
class? | | 1 |
| how to handle http request in struts | Polaris | 2 |
| What is the return type of read()? | | 2 |
| Difference between String and String Buffer? | | 3 |
| How will you create the class for the following scenario?
Employees under one employee?
| Bally-Technologies | 2 |
| Java violates few objected oriented concepts. Can you
explain in what way? | Ness-Technologies | 3 |
| What are null interfaces in JAVA ? and give me some
examples? | | 3 |
| What is lazy activation? | CMC | 1 |
| How can be define MARKER interfce in java | | 1 |
| Is multiple inheritance allowed in Java? Why ? | | 5 |
| how to convert mm/dd/yy to dd/mm/yy using collections in
java. | Bosch | 2 |
| Can we declare variables inside a method as Final Variables? | | 3 |
| what is a transient variable? | | 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 |
| In what circumstances, compiler will supply a default
constructor for a class? | | 4 |
| class A
{
class B
{
psvm(String args[])
{
}
}
}
if the prg saved in A.java whats the o/p? | HCL | 5 |
| In C we use only compiler. Why java uses both compiler and
interpreter? What is its significance? | | 5 |
| In Java why we write public static void main(String args[])
why not main()? | TCS | 12 |
| How does a try statement determine which catch clause
should be used to handle an exception? | | 2 |
| |
| For more Core Java Interview Questions Click Here |