Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to write a code that can browse the list of books

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to write a code that can browse the list of books

    Hi,
    Am a beginner in Java programming and would like assistance with java code that can browse the list of books,view a list of books,and view the status of books if borrowed or not.
    Book findBook (String isbn) {
    	int counter;
    	Book tmp;
    	String currentIsbn;
     
    	counter = 0;
     
    	for (counter = 0; counter < allBooks.size(); counter += 1) {
    		tmp = allBooks.get(counter);
     
    		currentIsbn = tmp.getISBN();
     
    		if (currentIsbn.equals(isbn)) {
    			return tmp;
      		}	
    	}	
    	return null;
    }
    Above is a code I've written to find the book.
    Thank you


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: How to write a code that can browse the list of books

    Crossposted here.

Similar Threads

  1. Replies: 7
    Last Post: May 8th, 2013, 02:33 PM
  2. How To Write This Code?
    By MuffinMan in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 14th, 2012, 12:02 PM
  3. How would you write this code?
    By laughingeyes18 in forum Object Oriented Programming
    Replies: 2
    Last Post: December 1st, 2011, 09:46 AM
  4. HOW TO PUT A BROWSE BUTTON IN JAVA?
    By mailtoramesh in forum AWT / Java Swing
    Replies: 4
    Last Post: November 16th, 2010, 12:17 AM
  5. How can i write this in code?
    By Mr. steve in forum Java Theory & Questions
    Replies: 2
    Last Post: November 30th, 2009, 10:07 PM