java - How can i change an arraylist object (int , string, boolean "false") to (int,String,boolean"true") and return it back to the array list? -


i'm new programing , i'm working on library interface better acquainted of aspects of java. i'm trying call checkoutbook(); method user enters book isbn, if statement iterates threw arraylist looking isbn. if it's there index try call book object change boolean value false show book not available. can't figure out how it. it's been few days of looking.

public void checkout() {     // todo auto-generated method stub     int q =  l.getreturnb();     if (cat.cat.contains(q)){          book r = cat.cat.get(q);         book b = new book(b.getisbn(),b.gettitle(),b.c); // c =         boolean value true.          r(b.getisbn(),b.gettitle(),false);         cat.cat.add(r);     } 

you have method inside book class called checkout changes book's boolean value false. call method inside if statement.

if(cat.cat.contains(q)) {  book r = cat.cat.get(q); r.checkout();  } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -