Java Tutorials
  • What is Java? Java is a widely used object oriented programming language, similar to Microsoft C#, but it's available for free!
  • Intro to Programming in Java (unix, pico):In this tutorial, you will see how to connect to a remote computer (using telnet), interact with the unix operating system, use the pico editor (to type in your program), use the javac compiler to translate your program, the java runtime to execute your program, and ftp to copy your program to your local PC. Certainly this development environment is primitive, old-fashioned, and difficult to use. However, it clearly demonstrates the separate functions of editing, compiling, and running. The newer development environments roll these functions together and so it is not as educational for the novice programmer.
  • If, Exceptions, Number Formatting. In this tutorial, you are presented with new java constructs and you are still using pico/unix. Programming style is stressed (comments, naming conventions, indentation).
  • Eclipse (and Methods): By now, you should be familiar with unix and pico and really ready to change to a more modern development environment. You're in luck! Eclipse (Classic) is a wonderful development environment, it works on all platforms, it installs first time, AND it's free! This tutorial shows you how to download, install and run your first program in eclipse. It also shows you how eclipse can automatically correct the indentation of your program and debug your program -- both VERY NICE features.
  • While Loops: the following sample programs all ask the user for a list of numbers to add. They progress from simple to just a little more complex:
    • Sum Numbers, asking user each time if they want to continue.
    • Sum Numbers, using a sentinel value and if statement to avoid processing the sentinel value.
    • Sum Numbers, using a sentinel value and if statement, but adding try/catch so that program will not abort if user enters non-numeric input.
    • Sum Numbers, using a sentinel value and if statement, moving try/catch code to a method (good programming style: separation of concerns).
    • Sum Numbers using the sentinel value, avoid processing the sentinel value by reading the first input value before loop and reading the next values at the end of the loop body (does not use try/catch).
    • Sum Numbers - final version, sentinel value, no if, try/catch in a method.
  • Random Numbers: you can have more fun programming once you know how to use random numbers. These three programs ask the user to guess a number between 1 and 100 (progress from simple to a little more comples).
  • Funs: Shoot Some Monsters !!