Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By JosAH

Thread: How to remove an array record??

  1. #1
    ProgRookie92 is offline Member
    Join Date
    Jul 2012
    Posts
    6
    Rep Power
    0

    Question How to remove an array record??

    Is there any coding on how to remove an array record???

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,525
    Blog Entries
    7
    Rep Power
    20

    Default Re: How to remove an array record??

    Forget about arrays; think in terms of ArrayLists.

    kind regards,

    Jo
    Eranga likes this.
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    ProgRookie92 is offline Member
    Join Date
    Jul 2012
    Posts
    6
    Rep Power
    0

    Default Re: How to remove an array record??

    Java Code:
    public static void main(String[] args){
    		Book[] b1 = new Book[100];
    		
    		b1[0] = new Book("ES","Bill Gate","zzz",2341);
    		b1[1] = new Book("AS","Steve Job","abc",4321);
    		b1[2] = new Book("IS","Iron Man","qwe",1234);
    		
    	}
    For example if i want to remove data in b1[1]?? Is there any ideas??
    Last edited by Eranga; 07-18-2012 at 03:39 PM. Reason: code tags added

  4. #4
    jhuber151 is offline Member
    Join Date
    Jul 2012
    Posts
    55
    Rep Power
    0

    Default Re: How to remove an array record??

    I am assuming that Book is your own class and not from the Java Book API, because that constructor does not exist. But like said by JosAH, it would be better to go with an ArrayList<Book> which has a remove(int) method.

Similar Threads

  1. [Help] .. How To remove an element of an array ?
    By Matty3z in forum New To Java
    Replies: 8
    Last Post: 12-27-2011, 07:14 PM
  2. Remove Duplicates in Array
    By HSKrustofsky in forum New To Java
    Replies: 11
    Last Post: 09-06-2011, 05:47 AM
  3. Replies: 9
    Last Post: 07-09-2011, 07:15 PM
  4. How can i remove a value from an array?
    By Meta in forum New To Java
    Replies: 3
    Last Post: 01-30-2011, 09:31 PM
  5. Storing a record set into an array
    By DJCali in forum New To Java
    Replies: 2
    Last Post: 10-25-2009, 02:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •