| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is difference between method overloading & method
overridding with example? | IBM | 2 |
| suppose in a class there is a code like this:
{
Set hs=new Hashset();
hs.add(new Emp("kathy",1000));
hs.add(new Emp("kathy",2000));
}
how can u avoid the above code in your class as set won't
allow duplicate objects? | | 2 |
| why java does not support mulitple inheritance directly? | TCS | 2 |
| when i write
string s1="java";
in one program(application) and
string s2="java";
in another application
on the same jvm will both objects s2,s2 will refer to same
memory location where "java" is stored
in string pool. | | 2 |
| I have a Person object with 5 variables and I want to store
them in a file called Person.txt. What should I do? | KPIT | 3 |
| What is cloneable interface? | | 5 |
| What enableEvents() method do? | | 1 |
| what is a transient variable? | | 4 |
| what is main purpose of interface? | Accenture | 2 |
| Can a for statement loop indefinitely? | | 3 |
| waht happens when a return type ,even void is specified for
a constructor? | | 10 |
| Can a double value be cast to a byte? | | 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 |
| what is difference between front controller and action servlet? | | 2 |
| what is the form of storage space in java? | | 5 |
| What is Applet Flickering ? | Persistent | 1 |
| what is wrapper class and its uses? | | 2 |
| what is diff bet iterator and enumeration? | | 2 |
| what is the difference between cd & dvd ? | Satyam | 11 |
| Name the class that used to read objects directly from a
stream? | Wipro | 2 |
| |
| For more Core Java Interview Questions Click Here |