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

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

  • 27 April

    Switch case in java

    Switch case in java is alternative to if else if ladder. It is used to execute statements based on some conditions. Syntax of Switch case in java [crayon-6a2975588f2d6977497016/] Let’s understand it with the help of simple example. We are going to print weekday based on integer. 0 represents Sunday, 1 represents Monday and so on.. […]

  • 27 April

    if else statement in java

    If else statements in java are used to test some conditions. It evaluates a condition to be true or false. There are three types of if statements. If statement If else statement If else if ladder statement Simple If statement [crayon-6a29755890044512683298/] For example: [crayon-6a2975589004c583842870/] Output: Price is greater than 10 You can write single line followed […]