title: How to remove an element previously added into an array?
body: <p>Could you please help me figure out how will I make it possible to create a delete command?
  in selection 5. I must use <strong>array</strong> not <code>ArrayList</code> neither <code>Vector</code>?</p>
  
  <p><strong>//Package ask1 main class Library</strong></p>
  
  <pre><code> package ask1;
  
  
   import java.lang.Object.*;
   import java.util.Scanner;
   import java.util.Arrays;
   import java.io.*;
  public class library {
  
  
  
  public static void main(String[] args) throws InstantiationException, IllegalAccessException {
  
  
  
  Management manager = new Management();
      Scanner input = new Scanner( System.in );
      Book vivlio = new Book();
  
      System.out.println("\n\t\t^*^*^*^*^*^*^* LIBRARY  MANAGEMENT ^*^*^*^*^*^*^");
  
      while(true){
      System.out.println("------------------MENU-------------------------------"); 
  System.out.print("\nENTER UR CHOICE\n\t1:Add a new Book\n\t2:Edit Book Infos\n\t3:Search a Book (with ISBN)\n\t4:Show all the Books\n\t5:Delete a Book (with ISBN)\n\t6:Exit \n   :");
  int selection;
  selection=input.nextInt();
   if (selection == 1)
   {
  
       System.out.println("Adding a new book ");
          String empty = input.nextLine();
          System.out.println("name of book:");
          vivlio.name = input.nextLine();
          System.out.println("Author:");
          vivlio.author = input.nextLine();
          System.out.println("ISBN:");
          vivlio.isbn = input.nextLine();
          System.out.println("Number of copies:");
          vivlio.number = input.nextInt();
          System.out.println("");
  
          manager.AddBook(vivlio);
  
   }
  
  
   else
       if (selection == 2) {
  
              System.out.println("Editing a Book ");
              System.out.println("Please enter title of book to edit:");
              String title = input.next();
              Book editingBook = findBookByTitle(title);
              if(editingBook == null) {
                  System.out.println("Sorry no book found with title name = " + title);
              } else {
                  //ask user for new price etc what ever you want to edit.
                  System.out.println("Please enter new values:");
                  String newValue = input.nextLine();
                  editingBook.setPrice(newValue);
                  // etc. other editing to book.
              }
          }
  
  
          else
              if (selection == 3)
              {
                  System.out.println("Searching a  Book ");
  
  
              }
              else
                  if (selection == 4)
                  {
                      System.out.println("You Choose to  view all       the Books  ");
                      manager.PrintAllBooks();
  
  
                  }
                  else
                      if (selection == 5)
                      {
                          System.out.println("You Choose to Delete a Book ");
                          String empty = input.nextLine();
                      }
                      else
                          if(selection == 6)
                          {
                              System.out.println("Library System Terminated!!! ");
                              String empty = input.nextLine();
                              System.exit(0);
                          }
                          else
                          {
                              System.out.println("Wrong Choice");
                          }
  
      }
  }
  
  private static Book findBookByTitle(String title) {
      // TODO Auto-generated method stub
      return null;
  }
  </code></pre>
  
  <p><strong><em>here is the second class called Book</em></strong></p>
  
  <pre><code>package ask1;
  
     import java.util.Scanner;
  
  
  
  
  
     public class Book {
  
  Scanner input = new Scanner( System.in );
  
  
        public String isbn;
        public String name;
        public String author;
        public int number;
  
  
      public String getIsbn() {
          return isbn;
      }
      public void setIsbn(String isbn) {
          this.isbn = isbn;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
      public String getAuthor() {
          return author;
      }
      public void setAuthor(String author) {
          this.author = author;
      }
      public int getNumber() {
          return number;
      }
      public void setNumber(int number) {
          this.number = number;
      }    
  
       String bookinfo = name + "    ," + author + "    ," + isbn;
  
  
      public void setPrice(String newPrice) {
          // TODO Auto-generated method stub
  
      }
  </code></pre>
  
  <p>}</p>
  
  <p><strong><em>And the third class called Management</em></strong></p>
  
  <pre><code>   package ask1;
  
     import java.lang.reflect.Array;
    import java.util.Scanner;
     import java.util.Arrays;
  
  
      public class Management  {
  public  Book[] books =new Book [60];
  String Sisbn;
  int current = 0;
  Library lib = new Library ();
  Scanner input = new Scanner( System.in );
  
    //Number 1
  
  
  public void AddBook(Book vivlio)
  {
      books[current]=vivlio;
      current++;
  }
  
      //Number 2
  
  
  public Book findBookByTitle(String title)
  {
  
      Book searchBook = null;
      for (Book vivlio : books)
      {
          if(vivlio.getName().equalsIgnoreCase(title)) 
          {
              searchBook = vivlio;
              System.out.println("New name of book:");
              vivlio.setName(input.nextLine());
              System.out.println("New Author of book:");
              vivlio.setAuthor(input.nextLine());
              System.out.println("New isbn of book:");
              vivlio.setIsbn(input.nextLine());
              System.out.println("New number of copies of book:");
              vivlio.setNumber(input.nextInt());
  
         break; }
      }
      return searchBook;
  }
  
  public String getSisbn() {
      return Sisbn;
  }
  
  public void setSisbn(String sisbn) {
      Sisbn = sisbn;
  }
  
  public Book[] getBooks() {
      return books;
  }
  
  public void setBooks(Book[] books) {
      this.books = books;
  }
  
  public int getCurrent() {
      return current;
  }
  
  public void setCurrent(int current) {
      this.current = current;
  }
  
  //Number3
  
  
  
  
      public Book findBookByISBN(String isbn) 
      {
          Book searchBook = null;
          for (Book vivlio : books)
          {
              if(vivlio.getIsbn().equalsIgnoreCase(isbn)) 
              {
                  searchBook = vivlio;
                  String book = vivlio.getName();
                  lib.once=vivlio.getName();
                  System.out.println(lib.once);
  
                  break;
              }
          }
  
          return searchBook;
      }
  
  
  
  
  //Number 4
  public void PrintAllBooks()
  {
          for (int i=0;i&lt;current;i++)
      {
              Book b = books[i];
              System.out.println(b.name);     
      }   
  }
  
  //number 5
  
    public Book DeleteWithIsbn(String isbn) 
      {
          Book searchBook = null;
          for (Book vivlio : books)
          {
              if(vivlio.getIsbn().equalsIgnoreCase(isbn)) 
              {
  
                  searchBook = vivlio;
                  books[current]=null;
                  for (int i=0;i&lt;current;current--)
                  {
                      Book b = books[i];
                  System.out.println(b.name);
                  break;
              }
              }
          }
  
          return searchBook;
      }
  }
  </code></pre>