Search:

Type: Posts; User: jaydac12

Search: Search took 0.09 seconds.

  1. Replies
    15
    Views
    1,405

    Re: Adding Object to ArrayList

    the addItem() is in the Library class, the user should add info first before adding it as a book object to the library class.
  2. Replies
    15
    Views
    1,405

    Re: Adding Object to ArrayList

    yes it should do that. It should create a Book object and store it in an array and the retrieveItem() method be able to retrieve what is store on the arraylist.
  3. Replies
    15
    Views
    1,405

    Re: Adding Object to ArrayList

    it is in the Book class. where in the Book class extends my library class. yes it compiles with no errors.
  4. Replies
    15
    Views
    1,405

    Re: Adding Object to ArrayList

    newBook.addItem(Integer.parseInt(idTF.getText()), dateTF.getText(), descriptionTF.getText(), Integer.parseInt(copiesTF.getText()),
    titleTF.getText(), newBook.getAuthor(),...
  5. Replies
    15
    Views
    1,405

    Re: Adding Object to ArrayList

    how should i do that?

    the add method? you mean like this? "newBook.add(new Book(args))"???
  6. Replies
    15
    Views
    1,405

    Re: Adding Object to ArrayList

    those statements are for storing the necessary info fro the book object in the arraylist. (i think)

    my code cant seem to add the necessary info to my arraylist that's why i cannot retrieve it by...
  7. Replies
    15
    Views
    1,405

    Re: Adding Object to ArrayList

    i have no errors may my logic is wrong...
    what do you mean by "Make the calls to the Book class's methods before adding the Book class object to the arraylist"?
    it is in my main class, i did not...
  8. Replies
    15
    Views
    1,405

    Adding Object to ArrayList

    import java.util.*;
    import javax.swing.*;
    public class Library
    {
    int id;
    String date;
    String description;
    int copies;
    String title;
    int bookCount;
Results 1 to 8 of 8