title: I have a piece of java code but it is running error now. Hope everybody help please
body: <pre><code>public static void main(String[] args) {
  
          List&lt;String&gt; list = new ArrayList&lt;String&gt;(Arrays.asList(&quot;20/04/2022&quot;, &quot;20/04/2022&quot;,&quot;20/04/2022&quot;,&quot;21/04/2022&quot;, &quot;22/04/2022&quot;, &quot;22/04/2022&quot;));
          List&lt;String&gt; list2 = new ArrayList&lt;String&gt;(Arrays.asList(&quot;1000&quot;,&quot;1000&quot;,&quot;1000&quot;, &quot;15000&quot;, &quot;36000&quot;, &quot;36000&quot;));
  
        
          for(int i=0;i&lt;list.size()-1;i++) {
              while ((list.get(i).equals(list.get(i + 1))) &amp;&amp; (list2.get(i).equals(list2.get(i + 1)))) {
                  list.remove(i);
                  list2.remove(i);
                  
              }
          }
          for (String alist : list) {
              System.out.println(&quot;list1: &quot;+alist);
          }
          for (String alist2 : list2) {
              System.out.println(&quot;list2: &quot;+alist2);
          }
  
      }
  
  </code></pre>
  <p><a href="https://imgur.com/a/yhGfz70" rel="nofollow noreferrer">image</a></p>
  <p><a href="https://imgur.com/a/DlZ5t3O" rel="nofollow noreferrer">image</a></p>