-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava specific questions
More file actions
97 lines (80 loc) · 3.48 KB
/
Copy pathjava specific questions
File metadata and controls
97 lines (80 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Time complexity of list , set and map ?
what if i write synchronised block inside the method in java, what will happen?
difference between collection and list and set ?
differnce between list and colletion ?
why do we use optional class in java ?
write a completableFuture class implementation ?
Runnable and callable in java ?
what do you know about concurrent hash map?
why and were do we use flatMap in java ?
what is the difference between multi tasking and multi threading ?
Exception handling ?
What is the difference between thread.start() and thread.run().
what is a volatile key word?
what is abstraction ?
difference between abstract and interface ?
what is a functional interface ?
how do we implement functional interface ?
what is a comparator and comparable ?
can we create an object for a abstract class ?
explain the steps for involved if i want to add employee class as a key to a map?
what is serialization ?
What is stateless in parallel streams ?
what JDK your using currenty?
any java 17 or 21 features?
ways of creating synchronized hashmap?
--Collections.synchronized(HashMap<>());
-- curcurrentHashMap
-- Map.of();
why did the implement date API ?
poor design.
years from 1900 and months from 0 .
old classes were mutable and not thread safe.
thread safe
more specific date and time methods.
optional class and its implementation methods ?
clear ....
what is the difference between ofNullable and of() in optional class ?
Ans : ofNullable() -- returns optional class if there is null value passed
of() -- returns null if you pass any of the null as an input.
How do you write a lambda expression, how do you call that ?
code implementation
@FunctionalInteface
Inteface GainKnowledge{
public void testMethod();
}
@FunctionalInteface
Inteface KeepGainKnowledge{
public void rockItNow(int a, String rockStar);
}
class Main{
public static void main(String args[]){
GainKnowledge gn=()->{
System.out.println("This world is so complex to win !!! ");
}
KeepGainKnowledge kgk=(a,s)->{
System.out.println( a + S);
}
gn.testMethod();
kgk.testMethod(10,"i am a rockstart here !!!!");
}
}
what is difference between .equals method and hashing method ?
how do you make a class immutable ?
how do we make a class or a method thread safe ?
what is volatile in java ?
what is try and try with resourse?
Distinct of object in list of employee ?
What is the difference between equals and hashing in Java?
What are the different ways of creating the a thread?
What is finally,finalize and final block used ?
What is the best way to create a thread ?
What is the difference between stream and parallel stream ?
Difference between interface and functional interface ?
What is a static method in Java ?
Functional interface before java8 ?
Why default method in functional interface?
Why do we use optional class in Java 8 ?
Executor service framework ?
What’s the difference between shallow copy and deep copy ?
Garbage collection is an automatic memory management process in Java that identifies and reclaims memory from objects that are no longer referenced by the program. It helps prevent memory leaks and ensures efficient memory usage. You can add points about different garbage collection algorithms, such as the generational garbage collector, which divides memory into young and old generations for more efficient processing. You can also mention that the garbage collector runs periodically and automatically, freeing up memory without requiring explicit programmer intervention.