• 09 July

    java program to check prime number

    This is easy question. It may not be asked you directly, but you can use this program to create many other complex program. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Program logic: If any number which is not divisible by any other […]

  • 07 July

    Reverse a linked list in java

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. In this post, we will see how to reverse a linked list in java. This is one of popular interview question. Java Linked List Interview Programs: How to reverse a linked list in pairs How to […]

  • 06 July

    Find nth element from end of linked list

    This is one of popular interview question. Java Linked List Interview Programs: How to reverse a linked list in java How to reverse a linked list in pairs How to find middle element of linked list in java How to detect a loop in linked list in java Find start node of loop in linkedlist […]

  • 06 July

    Find middle element of a linked list in java

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. This is one of the popular interview question. In this post, we will discuss how to find middle element in linkedlist in most efficient way. Java Linked List Interview Programs: How to reverse a linked list […]

  • 05 July

    How to detect loop in a linked list in java with example

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. One of the most popular interview question nowadays is “How to detect loop/cycle in LinkedList”. So I thought I should cover this question. This question is more related to data structure. You can also find start […]

  • Java 8 Lambda expressions
    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 […]

  • Interface default methods in java
    21 June

    Interface Default Methods in Java 8

    1. Introduction In this post, We will introduce default methods in interface which are introduced in Java 8. Have you ever encountered a situation where you created an interface and several classes implemented it? Now, suppose you need to add new methods to the interface. Doing so would lead to a multitude of compilation errors across […]

  • 19 June

    Difference between Abstract Class and Interface in java

    Some of the popular interview questions are “What are differences between abstract class and interface“. “When will you use abstract class and when will you use interface“. So in this article ,we will go through this topic. Before going through differences between them, Lets go through its introduction. Abstract class Abstract classes are created to […]

  • 18 June

    Comparable in java

    In this post, we will see  how you can use comparable to sort list of objects in java. Comparable interface: Class whose objects to be sorted must implement this interface.In this,we have to implement compareTo(Object) method. For example: [crayon-67bb161e8b019481448029/] If any class implements comparable inteface then collection of that object can be sorted automatically using […]