|
|
|||
![]() |
Department of Engineering |
| University of Cambridge > Engineering Department > computing help > Languages > |
Java's quite a new language which (unlike C++) wasn't forced to remain closely compatible with predecessors so it was able to take advantage of modern computing and programming developments. It was designed to be a "simple, object-orientated, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, and dynamic language". I won't go into all of those terms now but some are worth highlighting
Since its birth in 1996 it's been updated several times (in contrast, C++ is about to undergo its first major update since 1998). This speed of change, and the occasional problem with portability, meant that Java wasn't in its early days the stable, same-everywhere platform that people were hoping for. For a history, see the wikipedia entry. The current version (2011) is called Java 7. It's quite like C# or modern C++. generics are rather like C++ Templates. There's no multiple inheritance (though Interfaces fulfill a similar role) and no operator overloading. It has garbage collection (so fewer bugs? Less programming effort? Slower, bumpier performance?)
Almost everything except operating systems.
It still has trouble shaking off a reputation for slowness and memory-hungriness, but statistics suggest it's really not so bad.
As well as using computer science terms like "object-orientated" the Java world has its own jargon too
There's a lot to explore - over 2300 classes! All classes are in packages (usually easy enough to guess which package a class is in).
import java.awt.Graphics means that the Graphics class in the java.awt package is made known to the current class. import java.awt.* imports the whole package but not sub-packages. java.lang is automatically imported.
It's not always obvious where things are
To give you a flavour of what's possible, try the Java2D applet demo
Many books exist (though beware of versions). Don't expect an easy read: "Beginning Java 2" (Ivor Horton) is 1233 pages long; "Java in a Nutshell" (Flanagan) is 1225 pages long. Much information is online too.
Here are 3 suggestions
On the teaching system we have netbeans, a development environment for writing Java programs which also includes documentation.
| | Java | Languages | computing help | |