CS201 - Spring 2014 - Class 15

  • exercises

  • Admin
       - Midterm
          - As many notes as you'd like (within reason <20 pages)
          - review on Wednesday

  • Assignment 5 part 2 demo

  • Class feedback
       - Thanks!
       - textbook
          - more of a focus on the data structures side of the class
          - will get more relevant
       - examples from class
          - in the class notes for that day
          - I've put a link down in the "Resources" section to all of the examples
       - OnDiskSort assignment was underspecified
       - more details on the assignments
          - part of growing as a programmer is starting to learn to solve problems on your own
          - that said, if you're confused about what's expected of you, come talk to me
       - debugging and testing
          - write your code incrementally!
             - write one method
             - test it!
             - don't move on until you're sure it words
          - use print statements to help you track down bugs
          - use JUnit

  • JavaDoc: documentation in Java
       - http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html
       - JavaDoc is HTML documentation generated from the comments in your code
       - a way for you to communicate the "interface" to other programmers/users
       - /** is the beginning comment delimiter for classes/methods
       - Two basic parts
          - The document comment, which is written in HTML and is the first non-whitespace-line chunk of text
       - block tags. The main ones we'll use are below, but many more online
          - @author
          - @date
          - @param
          - @return
          - @throws
       - We can generate the HTML from the comments using eclipse (or on the command line)
          - In Eclipse: Project->Generate Javadoc...
          - in the left window, select the classes that you want to generate the javadoc for (generally, you should do one project at a time)
          - select the destination (the "doc" folder within the project is a good place)
          - click "finish" (or "next" if you'd like other options)
          - generate HTML output with the documentation!
       
  • JavaDoc example: Look at Card class in JavaDocExample code