1) Inheritance
2) Alternate ways of multiple inheritance
3) Child Class constains default constructor and static block. Also Parent class contains
default constructor. Which will invoke first, second and third.
4) Overloading vs Overriding
5) Service Executor in therad
6) Ways to start a thread
7) What is an error
8) If try without catch and finally, error or execute properly
9) I have one method, in one method I have a try-catch-finally, the method written type should be the integer. From try I am returning 1, catch I am returning 2, finally I am returning 3. So there are two scenarios possible inside the try block, either exception occur or either exception not occur. So what will be the output of that method if exception is occur and if not occur.
10) List vs Set
12) Hasp Map vs Tree Map
13) Map vs Set
14) Internal Working of Hash Map
15) Why is String immutable
16) If String s = new String("Name"). In which memory value will store.
17) doing some append, like concat part, adding surname So it will, the full string should be name surname. So you said that it's storing both Java heap and string constant.
So it will be updating in both the memory or it will create a new heap or it will change the string constant.
18) How to create a Immutable class
19) Thread Pooling
20) Dependency Injection
21) Let's take two interfaces are there. Okay, one class is there and two interfaces are there. Okay, so For an example, I'm defining Like Let's take one animal as an interface, okay? And two classes are there, dog and cat, and both are implementing that animal interface, okay? dog and cat, both are implementing animal interface, o
so animal is my interface, okay? I'm defining as a AutoWire. Okay, so that does not know like which class need to be instantiated, right? So that is a dependency ambiguity
How to resolve amibuity
21) Create a pyramid
No of value: 6
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
6 6 6 6 6 6
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
22) bacdeabcdabaabc
Repeat time more than 2
Find a character with no of time repeat
a - 5
b - 4
c - 3