Progress Software :
1. Given a stack:
push(A)
push(B)
push(C)
pop()
pop()
Peek()
what would be the output ?
2. What would be the performance of a hashmap or a hash table if all the keys map to same value.
A: Very poor as one of the basic reqmt of hashmap is that all the keys should map to a unique value.
3. class A{
method m1()
}
class B extends A{
method m1()
}
A a = new B();
Which method wud be called ?
Ans : B.m1()
4. What would be the output :
sysout(10+ "10");
Ans :1010
5. sysout(list);
where list is a string array of 3
o/p
Ans : Address of list.
6. Puzzle
3 containers
1 contains apple
1 contains oranges
1 contains mixture
label on all containers are wrong.
in hw many picks wud u find out which one contains wot ?
Ans : 1
pick one frm mixture.
we are sure tht it does not contain mixture.
if we get apple, it must contain apple.
Now, the one which has orange label id will surely not contain oranges and will not contain apples either.So it must contain
mixture.
thus the third one must contain oranges.