title: generating all IP address between two IP addresses in java
body: <p>I am trying to get all the IP addresses between the two addresses("168.200.197.3" and "238.199.200.78"). I splited the string to integer first. Then i tried to printout all addresses between these two. But the output only shows that each part of the address is being incremented, like 168 169 170......  I want the whole address to be increased(168.200.197.3, 168.200.197.4,168.200.197.5....etc). Please help !!!!!!!</p>
  
  <pre><code>public class IpAddress {
  
  
   public static void main(String[] args) {
      int [] ip1 = new int[4];
      int [] ip2 = new int[4];
  
      String [] parts1 = "168.200.197.3".split("\\.");
      String [] parts2 = "238.199.200.78".split("\\.");
  
      for (int i = 0; i &lt;4; i++){
          ip1[i] = Integer.parseInt(parts1[i]);   
                for (int j = 0; j&lt;4; j ++){
                      ip2[j] = Integer.parseInt(parts2[j]);
                             for (int k = ip1[i]; k&lt;ip2[j]; k++){
                                    System.out.println(k);
                                          }
                                   }  
                          }
        }
  }
  </code></pre>