Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!

Untitled

By: James763 on Dec 3rd, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   public void showNote(int noteNumber)
  2.     {
  3.         Note variable = notes.get(noteNumber);
  4.         if(noteNumber < 0) {
  5.             // This is not a valid note number, so do nothing.
  6.         }
  7.         else if(noteNumber < numberOfNotes()) {
  8.             // This is a valid note number, so we can print it.
  9.             System.out.println(notes.get(noteNumber));
  10.             System.out.println(notes.getTitle());
  11.             System.out.println(notes.getMessage());
  12.         }
  13.         else {
  14.             // This is not a valid note number, so do nothing.
  15.         }
  16.     }