Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

newbee cant find string

 
scott hanson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my mock library you can check for a title to borrow(this works),and return "if" you have a book to return.I can check a string in an object(!"".equals(book1.getTitle())).Cant figure out how to check for title if book is borrowed (borrowed object is book object with getTitle method).
???if (!"".equals(patron1.getBorrowed1()))???Im very newbee-ish,Need something like this,I think,maybe,well...er.Something that workd though.



\\my libraryinterface is a huge newbee(helloworld last fall)mess, Hope I pulled the relevant code.thankyou
ps no error message just incorrect results
[ edited to format code and to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ February 28, 2004: Message edited by: Dirk Schreckmann ]
 
David Peterson
author
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't tried to understand your code, but just from the first few lines of your message, is this what you need:
 
David Peterson
author
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might also like to look at some of the Java collections classes in the java.util.* package, and consider using a List or Set to hold the books.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic