- Help with installing java and running a program
- Running a program (old tutorial that is mostly replaced by the above one but might be worth reading if above is missing something)
- HelloWorld.java You can download this version directly. If you cut and paste in to notepad then make sure to be careful that the file is exactly HelloWorld.java and not helloworld.java or HelloWorld.java.txt or "HelloWorld.java"
- If you are having trouble finding the jdk 6 for windows 64 bit systems on the new layout of the page, you can try the following link. http://download.cnet.com/Java-SE-6-0-JDK-6/3000-2212_4-10857945.html
- I put together a list of some helpful command line tips to help you navigate the terminal: Command line tips You may find this useful in trying to run java from the command prompt or terminal window.
- Link to socs linux seminars (not required) In class I mentioned tutorials given by the CS deparment on linux. The information (which is outdated but will be updated at some point can be found at the link).
- Link to textbook (Sorry the link from the original version of the slides did not work. Click the java pdf from the link--Dan)
| week 1, week 2
|| What is programming? Structure of a Java program.
| week 3
|| Variables, expressions, and types; Reading from the keyboard; Writing to the screen.
| week 4
|| Using library methods, writing your own methods, if statements, boolean expressions, and comments.
| week 5
|| Loops and iterative methods: while loops, for loops, nested loops, static variables.
| week 6, week 7
|| Arrays, Basics of reference types, Examples of loops
| week 7, week 8
|| Object Oriented Programming basics
One key thing to get out of the Card and Point examples is that by making properties PRIVATE we have much more control over them. We can go through the Card.java file, check all the times that suit was set to different values, and make sure it never has an illegal value.
- Unit6 (draft)
- Jorg's slides
- Point.java (example using public properties which is a bad habit)
- Point2.java (example using private properties which take a bit more time to set up, but are definitely worthwhile in the end)
- DistanceCalculator.java (Demonstrates 3 ways of calculating the same thing. One with 3 arrays, one with Point which uses public properties (bad), and finally with Point2 which uses private properties (best method) You need to compile this with the Point.java and Point2.java files since it uses them.
- Card.java Card example mentioned in notes for unit 6. It should be viewed at the same time as CardGame.java . It is another example of using objects. (We'll get to this in class next week)CardGame.java
| week 9
|| More advanced objects/generics: ArrayList, HashSet, HashMap
| Week 10
- FibSlow.java (This took 1 hour to run on my computer and calculate fib(55). If you increase the size of the input by 1, I expect it to be 2 hours, increase by 2 is 4 hours, etc. Each time you increase the size by 1 it doubles the size)
- FibFast.java (This was basically instantaneous to calculate fib(65). The biggest limitation is running into the maximum size of an int. Perhaps we could use long to avoid this issue or at least delay that)
- WordDistance.java (compiles and runnable)
- SpellChecker.java (compiles and runnable)
- The spellchecker main method requires a file to be present in the same folder as the .java file. The file is a dictionary of all the words you want to compare it with, one word per line. I have tested on 2 sample dictionaries: one of all the hockey teams and one of an English dictionary I found on the web. The English dictionary is too big and at least on my computer the program doesn't terminate.
- HockeyDictionary.txt A small dictionary that works with the spell checker
- Dictionary.txt A large dictionary that is too big for my computer to handle the recursion of EACH word on
- Point.java (used with NavigateMaze.java example)
- NavigateMaze.java (compiles and runnable) Note: You are not responsible for understanding every detail of the code to be able to write it. But you should understand the general idea of it.
| Week 11
|| Exception Handling
- DownloadPages.java (example of using try/catch)
- NotesOnFolderExample.txt (notes directly from class so may contain compiler errors, etc)
- See the evaluation section with the practice final exams as well as the final exam "road map" shown in class.
|| Review Examples