1,105,594 Community Members

question about adding using ArrayList using terminal

Member Avatar
chmo
Newbie Poster
3 posts since Nov 2010
Reputation Points: -2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

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!!!

Member Avatar
masijade
Industrious Poster
4,165 posts since Feb 2006
Reputation Points: 1,351 [?]
Q&As Helped to Solve: 510 [?]
Skill Endorsements: 22 [?]
Team Colleague
Featured
 
-1
 
Member Avatar
masijade
Industrious Poster
4,165 posts since Feb 2006
Reputation Points: 1,351 [?]
Q&As Helped to Solve: 510 [?]
Skill Endorsements: 22 [?]
Team Colleague
Featured
 
0
 

So, why do you disapprove of warning others to check and make sure that they are not wasting their time?

Member Avatar
masijade
Industrious Poster
4,165 posts since Feb 2006
Reputation Points: 1,351 [?]
Q&As Helped to Solve: 510 [?]
Skill Endorsements: 22 [?]
Team Colleague
Featured
 
0
 

Essentially crossposts
Number 1
Number 2
Number 3
Number 4

Member Avatar
masijade
Industrious Poster
4,165 posts since Feb 2006
Reputation Points: 1,351 [?]
Q&As Helped to Solve: 510 [?]
Skill Endorsements: 22 [?]
Team Colleague
Featured
 
0
 

Possibly another.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article