Core Java interview
- 17 May
Java CyclicBarrier Example
In this post, we will see about CyclicBarrier in java. CyclicBarrier was introduced in Java 5 with other concurrency utils such as CountDownLatch, ConcurrentHashMap and BlockingQueue. CyclicBarrier is synchronized aid which allows set of threads to wait for each other at common barrier points.It is called cyclic because it can be reused once waiting threads […]
- 27 April
Java ReentrantReadWriteLock Example
In this tutorial, we will see ReentrantReadWriteLock Example. ReentrantReadWriteLock supports semantics of ReentrantLock and also ReadWriteLock. ReadWriteLock has two locks, one for read and one for write. Request for read lock from multiple threads can be acquired if there is no write request. If there is a write request, no other thread will be able to […]
- 01 March
Java OOPS interview questions and answers
In this post, we will see most important Oops interview questions in java. 1. What are some core concepts of OOPS in java? Core concepts of OOPs are : Polymorphism Abstraction Encapsulation Inheritance 2. What is Abstraction? Abstraction is a concept of showing only important information and hiding its implementation.This is one of the most […]
- 22 February
Java Exception Handling Interview Questions And Answers
Exceptional handling is one of the most important topics in core java. Here is list of questions that may be asked on Exceptional handling. Question 1: What is Exception ? Answer: Java doc says “ An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program’s […]
- 18 February
Method overloading and overriding interview questions in java
In this tutorial, we are going to see Method overloading and overriding interview questions. 1. What is method overloading? Answer: If two or more methods have same name, but different argument then it is called method overloading. For example: Array’s sort method have many overloaded versions. You can sort array of double, int, String etc. 2. […]
- 16 February
Java Multithreading and Concurrency Interview Questions
In this tutorial, we are going to see Multithreading interview questions with answers. Here is list of Java Multithreading interview questions. Java multithreading interview questions 1. What is thread in java? Answer: Thread can be called as light weight process. It can be referred as smallest part of process which can be executed concurrently with […]
- 14 February
Java Serialization interview questions and answers
Serialization is one of most important concept in java. If you are going to face core java interview, then you might be asked some questions from Serialization. Java Serialization Tutorial: Serialization in java Java Serialization interview questions and answers serialversionuid in java serialization externalizable in java Transient keyword in java Difference between Serializable and Externalizable […]
- 09 January
Java ExecutorService example using Callable and Future
Callable interface represents a thread that can return a value. It is very much similar to Runnable interface except that it can return a value. Callable interface can be used to compute status or results that can be returned to invoking thread. For example: Let’s say you want to perform factorial and square of some […]
- 23 December
Java Semaphore example
In this tutorial, we are going to see about Semaphore in java. Semaphore is a class in java.util.concurrent package introduced in JDK 5. Semaphore basically maintains a set of permits, so there are two methods which are mainly used for semaphore. acquire release acquire() method is used to get a permit and if no. of […]