• 19 May

    Core Java Tutorial with Examples for Beginners & Experienced

    1. Introduction This blog post offers a comprehensive Core Java tutorial tailored for both beginners and experienced programmers. The topics compiled and presented in this tutorial will help you build your foundation in Java, covering both the basic fundamental topics and the advanced topics that will make you an expert in Java. It will definitely […]

  • 22 May

    this keyword in java with example

    this keyword in java is used to refer to current object or instance of class. It can be used in the constructor to call any other overloaded constructor but this keyword should be the first statement in the constructor. This keyword can be used for instance variables this keyword can be used to refer to the […]

  • 20 May

    Java newFixedThreadPool Example

    In this tutorial, we will learn about Executor’s newFixedThreadPool factory method. In the last tutorial, I have shared an introduction to ThreadPoolExecutor. If you are not aware of concepts of ThreadPoolExecutor, you should go through that first. Executor’s newFixedThreadPool factory method : This method returns ThreadPoolExecutor whose maximum size(let’s say n threads) is fixed.If all […]

  • Java CyclicBarrier Example
    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 […]

  • 02 May

    Encapsulation in java with example

    Encapsulation in java is the process of binding related data(variables) and functionality(methods) into a single unit called class. Encapsulation can be achieved by using access modifier such as public, private, protected or default, so your class will be safe from unauthorized access by others and will be simple to maintain. We can create fully encapsulated […]

  • 27 April

    Abstraction in Java

    1. Introduction Abstraction is a concept of exposing only essential details and hiding implementation details. It is one of the essential OOPs concept apart from encapsulation, inheritance and polymorphism. Abstraction retains only information which is most relevant for the specific purpose. For example: ArrayList stores objects sequentially as list, and you can use the add() method […]

  • 27 April

    Interface in java

    In previous post, we have seen abstract class in java which provides partial abstraction. Interface is one of the core part of java and is used to achieve full abstraction. Interface is generally used to provide contract for class to implement. Interface do not have implementation of any method.A class implements an interface, thereby inheriting […]

  • 27 April

    Abstract class in java

    An abstract class is the class which is declared abstract and can have abstract or non abstract methods. An abstract class can not be instantiated. It can be extended by subclass to implement abstract methods and either use or override concrete methods. Abstract method in java Abstract method is the method which do not have […]

  • Java ReentrantReadWriteLock Example
    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 […]