A lowdown on... Java
Posted on 21 Nov 2001 at 16:43
/*
Display "Hello World!" to the standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
//display the text
System.out.println("Hello World!"); }
}
Here's the same functionality in 'Applet' form. (An applet is a program running within the context of another program, such as a Web browser. Generally, it will have limited access to the system it is running on.)
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorld extends Applet {
public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25); }
}
You may have a Java environment installed on your PC without being aware of it, perhaps installed to support the Java features of an application. For example, under a JavaSoft directory, I have a Java 1.3.1 Runtime Environment, with bin and lib subdirectories for binary executables and library files. I didn't explicitly search this out - it was installed as part and parcel of an application that required Java support for some of its features, for example the Opera browser.
This runtime environment supports the use of Java on your machine - Java can execute within this space. As long as a machine has runtime support for Java - and a Mac's support will differ from a Unix box, which in turn differs from a particular Windows platform - the application can carry out its functions.
If you are interested in finding out more and looking into Java in more detail, here are a few sites of interest on the Web.
Sun Microsystems, as you would expect, has a wealth of material on Java, from the perspective of both users and developers. Here are some of the main ways into its online content:
java.sun.com/docs/books/tutorial/
Here are some guides to getting started with Java code yourself:
developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/
developer.java.sun.com/developer/onlineTraining/Programming/BasicJava2/
Finally, numerous third-party sites also focus on the Java programming language. Type the keywords into your search engine of choice and you will be inundated. Here are just a few to get you started.
www.gnu.org/software/java/java.html
The low-down on programming languages
Author: Alun Williams
advertisement
- Why Britain's watchdogs have fewer teeth than goldfish
- Tabbed documents: how to make Office 2010 great
- Outlook 2010 People Pane – does it spell death to Xobni
- Microsoft Outlook 2010 screenshots
- Co-Authoring in Word 2010 and SharePoint Foundation 2010
- Microsoft Outlook 2010 screenshots: Backstage view
- Flash 10.1: Developing for Desktop and Device
- Microsoft Office 2010 screenshots: Recover unsaved items
- Microsoft Word 2010 screenshots: Text Effects
- Microsoft Word 2010: inserting screenshots
- Getting to grips with Microsoft's IT Health Environment Scanner
- Virtualise your servers
- The changing face of travel gadgets
- Build your own distributed file system
- The bulletproof Dell that costs an arm and a leg
- Microsoft Office 2010 Technical Preview: Q&A
- Lawnmowers, the TyTN II and one odd insurance request
- There'll never be a bulletproof OS
- How far can we trust apps?
- Five nice touches in Outlook 2010
advertisement
Printed from www.pcpro.co.uk


