title: I have a little problem in the delete function.After i delete a certain data,the remaining 2 datas keeps their id numbers stays constants
body: <ol>
  <li><p>This is the code</p>
  <pre><code>  import java.util.Scanner;
    import java.util.ArrayList;
  
    public class Main{ 
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            ArrayList&lt;String&gt; name = new ArrayList&lt;String&gt;();
            boolean initiated = false;
            int personID = 0; //Numbering the profiles
            int operation = 0; //User Choice
            int target = 0; //Targeted profile
  
            while(operation != 0|| initiated == false){
                System.out.println(&quot;============================&quot;);
                System.out.print(&quot;1-Add Person\n2-Edit Person\n3-Delete Person\n4-Print Report\nSelect Option: &quot;);
                operation = scanner.nextInt();
                System.out.println(&quot;============================&quot;);
  
                if(operation == 1){
                    personID++;
                    Add(scanner, personID, name);
                }
                else if(operation == 2){
                    Edit(scanner,target,name);
                }
                else if(operation == 3){
                    System.out.println(&quot;PROFILE DELETE&quot;);
                    Delete(scanner, target, name);
                    personID--;
                }
                else if(operation == 4){
                    System.out.println(&quot;Reporting Records..&quot;);
                    Report(name);
                }else{
                    System.out.print(&quot;Input Error!&quot;);
                    return;
                }
  
                if(operation != 4){
                    Report(name);
                }
                initiated = true;
            }
        }
        public static void Add(Scanner scanner, int personID, ArrayList&lt;String&gt; name){
            System.out.println(&quot;PROFILE ADD&quot;);
  
            name.add(Integer.toString(personID));
            String dummyScaner = scanner.nextLine(); //DOes Nothing but makesure FName gets an input
            System.out.print(&quot;Enter First Name: &quot;);
            String input0 = scanner.nextLine();
            name.add(input0);
            System.out.print(&quot;Enter Last Name: &quot;);
            String input1 = scanner.nextLine();
            name.add(input1);
            System.out.print(&quot;Enter Age: &quot;);
            String input2 = scanner.nextLine();
            name.add(input2);
        }
        public static void Edit(Scanner scanner, int target, ArrayList&lt;String&gt; name){
            System.out.println(&quot;PROFILE EDIT&quot;);
            Report(name);
            System.out.print(&quot;Enter Number you want to update: &quot;);
            int targetID = scanner.nextInt();
  
            target = (targetID-1)*4;
  
            System.out.print(&quot;Enter First Name: &quot;);
            String dummyInput = scanner.nextLine();
            String input0 = scanner.nextLine();
            name.set(target+1,input0);
            System.out.print(&quot;Enter Last Name: &quot;);
            String input1 = scanner.nextLine();
            name.set(target+2,input1);
            System.out.print(&quot;Age: &quot;);
            String input2 = scanner.nextLine();
            name.set(target+3,input2);
            System.out.println(&quot;Number &quot;+target+&quot; updated successfully!&quot;);
        }
        public static void Delete(Scanner scanner, int target, ArrayList&lt;String&gt; name){
            System.out.println(&quot;PROFILE DELETE&quot;);
            Report(name);
            System.out.print(&quot;Enter Number you want to delete: &quot;);
            int targetID = scanner.nextInt();
  
            target = (targetID-1)*4;
  
            name.remove(target+3);
            name.remove(target+2);
            name.remove(target+1);
            name.remove(target);
  
            System.out.println(&quot;Number &quot;+target+&quot; deleted successfully!&quot;);
        }
        public static void Report(ArrayList&lt;String&gt; name){
  
            System.out.println(&quot;============================\n&quot;);
            System.out.print(&quot;No. | First Name | Last Name | Age&quot;);
            for (int i = 0; i &lt; name.size(); i++) {
                if(i%4==0){
                    System.out.println(&quot;&quot;);
                }
                System.out.print(name.get(i)+&quot; | &quot;);
            }
            System.out.println(&quot;&quot;);
        }  
    }
  </code></pre>
  <p>//To Do List:
  //Fix: Delete Function
  // Issue: When deleting a profile, with id number, the profile ID remains constant and does not adapt to new profile count.
  // Ex: you have 3 profile and then you decided to delete 3. there will be 1 and 2 left.
  //      But if you decided to delete 2 instead, it'll show 1 and 3 instead of being 1 and 2.        This is the to do list
  <a href="https://i.stack.imgur.com/bGpFs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bGpFs.png" alt="Output" /></a></p>
  </li>
  </ol>