| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Why Java is a platform independent language? | Zensar | 4 |
| Howmany number of objects we can store in an ArrayList. Is
there any limit? | TCS | 5 |
| How to eliminate duplicates from an array? | Wipro | 3 |
| What is the difference between a public and a non-public
class? | | 2 |
| how can u create the object with out new operator | | 2 |
| How can we find size of the object ? | RazorSight | 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 |
| In the first round, there are 30 aptitude and 30 java
questions. We are suppose to finish both the papers within
60 minutes.
I cleared this round.
Next was test for programming skills.
In this section, Some 7 n's were asked.
1.
What is the difference b/w sleep(1000) and wait(1000)
2.
what is the diff b/w static block and static function?
3.
Write a program to validate IP address using string
tokenizer.
4.
Write a program to create singleton class
5.
write a function to reverse the string
6.
Write a prog to print prime nos upto n. EX: If n=9, It shld
print 1,2,3,5,7
7. One program on collections- Write a program to print no.
of times a number is repeating in an array.
EX- {1,3,1,2,5,7,3,7,34,3,8,3}
It should print: 1- 2 times
3- 4 times and so on
7. Write a func to print fibonocci series
After this I had technical interview, which went on for.
60 mins or so. There were qn's about multi threading,
Exception handling and collection classes.
Knowledge about collections was very important for the
post I was interviewed for. | Huawei | 1 |
| JSP is by default thread safe or not? what is the meaning of
isThreadSafe="true" and isThreadSafe="false". Explain it?
Thanks,
Seenu | Huawei | 3 |
| why java not supproting multiple inheritance?
| | 5 |
| what is main purpose of interface? | Accenture | 2 |
| What is I/O Filter? | TCS | 1 |
| wHAT IS DEFAULT SPECIFIER IN JAVA
wHAT IS DEFAULT CONSTRUCTOR IN JAVA
wHAT IS DEFAULT METHOD IN JAVA | IBM | 10 |
| What is the purpose of the File class? | | 2 |
| Define interface? | | 2 |
| wahts is mean by thread? | HCL | 14 |
| what is java | | 9 |
| Are nested try statements are possible? | | 2 |
| How to call static method? | Epoch | 3 |
| what is abstract method with example? | Virtusa | 5 |
| |
| For more Core Java Interview Questions Click Here |