• 15 February

    Difference between notify and notifyAll in java

    In this post, we are going to see difference between notify and notifyall in java. notify(): When you call notify method on the object, it wakes one of thread waiting for that object. So if multiple threads are waiting for an object, it will wake of one of them. Now you must be wondering which […]

  • 15 February

    Difference between process and thread in java

    In this tutorial, we are going to see differences between process and thread in java. If you are working on multithreading in java, it is good to know differences between process and thread. How multithreading can improve performance by executing code in parallel. Process vs Thread: The process can be referred as program in execution […]

  • 15 February

    Difference between throw and throws in java

    In this tutorial, we are going to see difference between throw and throws in java. throw: throw keyword is used to throw any custom exception or predefine exception. For example: Let’s say you want to throw invalidAgeException when employee age is less than 18. Create a Employee class as below. [crayon-6638ef9d20e2f836770652/] Create InvalidAgeException class as […]

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

  • 14 February

    Difference between Serializable and Externalizable in Java

    In this tutorial,  we are going to see differences between Serializable and Externalizable interface in Java. 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 in Java Before understanding difference, let me provide a short note on Serializable […]

  • 02 February

    Rotate an array by K positions

    In this tutorial, we will see how to rotate an array be K positions. Problem: N=6 and k=2 If Arr[] = {1, 2, 3, 4, 5, 6} and k=2 then [rotated array](https://java2blog.com/search-element-in-sorted-and-rotated-array-java/ “rotated array”) will be  {5, 6, 1, 2,  3,  4} Solution: There are multiple ways to solve this problem. Approach 1: Move each […]

  • 20 January

    How to check if number is power of two

    In this tutorial, we will see how to check if number is power of two. There are many approaches to check if number is power of two or not. Approach 1: It is very easy and straight forward approach. Run a while loop which checks for condition if n is even number (n%2==0). If n is […]

  • 16 January

    How to prepare for AWS Certified SysOps Administrator Associate certification exam

    In my previous articles, I have written about solutions architect exam and list of AWS certifications. AWS is the market leader in the cloud computing platform. If you are planning to switch your career to cloud computing, then AWS is the right place to start your learning process. Microsoft Azure is the only competitor for […]

  • 13 January

    Android SQLite Database CRUD example

    In this tutorial, we are going to learn about Android SQLite database CRUD example. Android SQLite is open source relational database which can be used for performing crud operations. You don’t have to do explicit installation for it. It is available by default in android. Let’s start with simple example: In this example, we will […]