Core Java interview
- 22 December
Immutable class interview questions
In this post, I am going to share java interview questions which are generally asked on immutable class. Immutable class is important topic as it deals with creation of thread safe class. Here I am providing some important immutable class interview questions with answers. 1. What is immutable class? Answer : Immutable objects are those […]
- 01 September
Collectors.groupby example : How to do group by in java
We have already seen some examples on Collectors in previous post. Â In this post, we are going to see Java 8 Collectors groupby example. Groupby is another feature added in java 8 and it is very much similar to SQL/Oracle. Lets understand more with the help of example: Lets create our model class country as […]
- 15 July
Java String Interview questions and answers
In this post, we will see interview questions on java String. String is most important data type which we use in our programs very often. 1. Why String is declared final or immutable in java? There are various reasons to make String immutable. String pool Thread Safe Security Class Loading Cache hash value You can […]
- 14 July
Core java interview questions and answers
Core java interview questions play a vital role in java/j2EE interviews. Whether you are fresher or experienced, you are going to face core java interview questions. You can also go through top java interview programs for practicing java programs. Here I am providing some important core java interview questions with answers. 1. What do you […]
- 11 July
Difference between CountDownLatch and CyclicBarrier in java
In this post, we will see difference between CountDownLatch and CyclicBarrier in java. Lets first see similarities among them. Both wait for specific number of threads or tasks to finish. Lets see differences between CountDownLatch and CyclicBarrier. CountDownLatch vs CyclicBarrier Parameter CountDownLatch CyclicBarrier Reuse It can not be reused once count reaches 0 It can […]
- 12 April
Java Collections interview questions and answers
In this post, I am going to share some of logical java Collections interview questions which will help to understand Collections concepts better. For an extensive list of java programs, please go to Java interview programs. Question 1: What can be output of below code : [crayon-6768246f8c3ab598859024/] options are :Â A)France France India B)India India […]
- 08 August
CountDownLatch in java
As per java docs, CountDownLatch is synchronisation aid that allows one or more threads to wait until set of operations being performed in other threads completes.
- 26 November
ConcurrentHashMap in java
ConcurrentHashMap was introduced in Java 5 with other concurrency utils such as CountDownLatch, CyclicBarrier and BlockingQueue. ConcurrentHashMap in java is very similar to HashTable but it provides better concurrency level. You might know , you can synchonize HashMap using Collections.synchronizedMap(Map). So what is difference between ConcurrentHashMap and Collections.synchronizedMap(Map)In case of Collections.synchronizedMap(Map), it locks whole HashTable […]
- 22 June
Lambda Expressions in Java 8
1. Introduction Java 8 has introduced a new feature called Lambda expressions. This is considered to be major change for Java because it introduces a way of programming that is more about actions than the details of how things are done. Other languages such as Scala already have this feature so this is not new […]