• 01 August

    Java program to reverse a String

    In this post,  we will see java program to reverse a String. There are many ways to do reverse a String in java, some of them are: Using for loop Declare empty String reverse. This will contain our final reversed string. Iterate over array using for loop from last index to 0th index Add character […]

  • 01 August

    How to swap two numbers without using temporary variables in java

    In this post, we will see how to swap two numbers without using temporary variables. There are three ways to do it. Java program: [crayon-6781448bb0bf4243175956/] When you run above program, you will get following output: [crayon-6781448bb0bf8659424652/] Third way is fastest of all. Please go through Interview programs in java  for more such programs.

  • 17 July

    How to configure Apache Tomcat in eclipse

    In this post, we will see how to configure apache tomcat in eclipse. As per wikipedia, Apache Tomcat, often referred to as Tomcat, is an open-source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and […]

  • 10 July

    wait, notify and notifyAll method in java with example

    You might have noticed Object class has three final method called wait, notify and notifyAll. These methods are used for inter thread communication.  Java 5 has introduced executor framework which takes care of inter thread communication for you and internally uses wait, notify and notifyAll but you still require basic understanding of these methods and […]

  • 08 July

    Binary search 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 perform binary search in java using divide and conquer method.When you want to find a value in sorted array, we use binary search and we will also see […]

  • 28 June

    Java bloggers meet to celebrate 20th birthday of java, hosted by oracle

    Oracle has invited java bloggers at Hyderabad campus on 13th June 2015 and we celebrated Java ‘s 20th birthday. Few days back, I got an invitation mail for this event and I was more than happy to join them. It was really pleasure to meet other java bloggers and interact with them. It started with […]

  • 25 June

    How to iterate over Map or HashMap in java

    In this post, we will see how  can we iterate a map in java. There are four ways of iterating over a map, HashMap or TreeMap. Java HashMap tutorial: HashMap in java How HashMap works in java hash and indexfor method in HashMap hashcode and equals method in java How to sort HashMap by keys […]

  • 24 June

    How to iterate a list in java

    In this post, we will see how  can we iterate a list in java. There are four ways of iterating over a list. For loop For each loop(Java 5) While loop Iterator Below example will help you to understand, how to iterate list in java. I am taking custom object list to understand better 1. […]

  • 17 June

    Difference between ArrayList and LinkedList in java

    One of the common interview question is “What is difference between ArrayList and LinkedList”.Before we actually see differences,let me give you brief introduction of both. ArrayList ArrayList is implementation of list interface. ArrayList is not synchonized(so not thread safe) ArrayList is implemented using array as internal data structure.It can be dynamically resized . LinkedList LinkedList […]