[ANU] [DCS] [COMP2100/2500] [Description] [Schedule] [Lectures] [Labs] [Homework] [Assignments] [COMP2500] [Assessment] [PSP] [Java] [Reading] [Help]
COMP2100/2500
Java(This page is new, so you should expect it to change and grow significantly over the course of the semester.)
About Java
We will be using Java 1.5 in COMP2100/2500 this semester. This new version of the language has some distinct advantages over earlier versions, namely:
a convenient way to read input from the console using the Scanner class (at last);
automatic conversion from int to Integer etc. and back again; and
generic classes, that greatly improve type-safety in data structures.
For more information about Java 1.5, see the article Programming with the New Language Features in J2SE 5.0.
Java 1.5 is available for Windows and Linux, but unfortunately for those of us with Macs at home, it is not yet available for Mac. We have a few options:
Do all our Java programming at uni; or
Only use features available in Java 1.4 (or whatever version we happen to be running).
Java documentation
The first place to look is the Sun Java website. This has lots of information, some of it very helpful, some of it incomprehensible, some simply irrelevant. You might want to skip straight to their Java 1.5 page.
Every time you sit down to program in Java, you will need to use the API Documentation. This gives the full specification (and some helpful description) of the entire Java standard libraries, including the GUI (graphical user interface) libraries. Take the time to get to know this documentation, because you will use it all the time.
Downloading web pages from the Sun Java site costs us money, so if you are working in the labs, you should look at our local mirror copy of the Java API docs instead. (As of 14th February 2005 this isn't working, but we've put in a request and it should be fixed soon.)
The precise definition of the Java language and how it should work is contained in the Java Language Specification, but my guess is that you're unlikely to find anything useful in this extremely technical document.
Java programming environment
Part of the point of this course is for you to become familiar with the standard basic programming environment, consisting of a text editor (Emacs) and a command line.
But we will also be experimenting a little with Integrated Development Environments. Initially we will use DrJava. This is a fairly basic IDE, but it does have some very nice features, in particular the “Interactions Pane”, which is a Java interpreter. In it you can type individual lines of Java and have them executed immediately. This is great for fiddling around trying to get a complicated line correct — much quicker than editing the file, compiling the program and running it. You can then cut & paste the correct line of code into your program.
Later in the semester we may (or may not) have a look at Eclipse, a large, open-source, extensible integrated development environment.
Other Java resources
There are some useful links to Java tutorials, books, and other useful information like installation guides available from the COMP1100 Java Page.
For those of you changing languages from Eiffel to Java this semester, Patrick Harrison has written Eiffel to Java for COMP1110 students, which you may find useful. (It doesn't look very good on my screen, but it prints just fine.)
About Emacs
In response to a query about Emacs on Windows, I present some links here. Do read the Emacs for Windows README. Then download djtarnt.exe, emacs-21.3-fullbin-i386.tar.gz, and eiffel.el. Install the latter in the site-lisp directory and follow its instructions in the INSTALLATION section.
[ANU] [DCS] [COMP2100/2500] [Description] [Schedule] [Lectures] [Labs] [Homework] [Assignments] [COMP2500] [Assessment] [PSP] [Java] [Reading] [Help]
Copyright © 2005, Ian Barnes and Richard Walker, The Australian National University
Version 2005.2, Monday, 14 February 2005, 16:27:23 +1100
Feedback & Queries to
comp2100@cs.anu.edu.au