Results 1 to 4 of 4
  1. #1
    chmo is offline Member
    Join Date
    Nov 2010
    Posts
    3
    Rep Power
    0

    Post question about adding using ArrayList using terminal

    hi...
    I have some questions...
    Firstly, I have an ArreyList that is stored two String "Name", "Description"
    This is a database of students

    private void addStudents ()
    {
    addStudent("ABC","lalala");
    addStudent("DEF","hohoho");
    }

    I also have the methods that adds, modify and delete students from the term list.

    protected boolean addStudent (String name, String description)
    {
    boolean added = false;
    if (!nameExists(name)) {
    namesList.add(new Student(name, description));
    addNameToList(name);
    added = true;
    }

    return added;
    }

    Using this for example I can add new students in my list. The problem is that I want to have interaction using BlueJ terminal. That means that:

    while (!name.equals("add new"))
    {
    addName (String name, String description)
    }

    I know that is is not true... I want any suggestion about what should I do to do this work?

    tnx!!!

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

  3. #3
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    Essentially crossposts
    Number 1
    Number 2
    Number 3
    Number 4

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

Similar Threads

  1. Replies: 7
    Last Post: 09-26-2011, 11:29 PM
  2. adding date in arraylist
    By katturv in forum New To Java
    Replies: 1
    Last Post: 10-23-2010, 06:23 PM
  3. ArrayList question
    By spatel14 in forum New To Java
    Replies: 4
    Last Post: 07-07-2010, 10:02 PM
  4. arraylist question
    By lisa.lipsky in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-16-2009, 11:07 AM
  5. Null Pointer Exception when adding items to ArrayList
    By ShadowCopy in forum New To Java
    Replies: 3
    Last Post: 08-27-2009, 09:23 AM

Posting Permissions

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