Hi, I have a problem that when you delete an array record between some numbers the rest will be deleted.
For Example
I'm only going to delete booknum[6] -- then the booknum[7] booknum[8] booknum[9] and so on.. will be deleted
Any solution how to adjust booknum[7] into booknum[6], booknum[8] into booknum[7] and so on
System.out.print("Please Enter the Book Number you want to Destroy: ");
a6=Integer.parseInt(br.readLine());
if(booknum[a6] != null && booknum[a6] != ""){
if(bookstatus[a6].equals("Available")){
System.out.println("Book "+ bookname[a6] + " is Eliminated");
booknum[a6]=null;
bookname[a6]=null;
bookdesc[a6]=null;
bookstatus[a6]=null;
Here is the snippet code
do{ System.out.println("----"); System.out.println("Deleting Books to the Record"); c6=0; System.out.println("Please Choose a Book Below"); System.out.println("Book Number // Book Name // Book Description"); if(booknum[1] == null) { System.out.println("Empty Record"); c6++; } else { for (int i6 = 0; i6 < booknum.length; i6++){ if(booknum[i6] != null && booknum[i6] != "") { if(bookstatus[i6].equals("Available")) { System.out.println(booknum[i6]+" \t\t "+bookname[i6]+" \t\t "+bookdesc[i6]); c6++; } } } if(c6==0){ System.out.println("No Books are Currently Available for Deleting"); }else{ System.out.print("Please Enter the Book Number you want to Destroy: "); a6=Integer.parseInt(br.readLine()); if(booknum[a6] != null && booknum[a6] != ""){ if(bookstatus[a6].equals("Available")){ System.out.println("Book "+ bookname[a6] + " is Eliminated"); booknum[a6]=null; bookname[a6]=null; bookdesc[a6]=null; bookstatus[a6]=null; } }else{ System.out.println("Book is not yet available"); } }
Thanks in advance for any help