Printing to Standard Output
Okay, as you may have guessed from the code in the last section, you can direct Java to print to standard output using the System.out.println() method.
We will talk more about the specifics of methods, but for the time being it would be good for you to know that you can print to the command line (applications) or to the Java Console (applets) using the following:
System.out.println(string);
For example:
System.out.println("Hello Cyberspace!");
Below is a screen shot of the Netscape Java Console.
Note that you can access the Java console in Netscape using the Communicator->Java Console menu item.
In IE, on the other hand, you actually need to instruct the browser to give you access.
You can do this by going to the Tools->Internet Options->Advanced->VM menu item and clicking "Java Console Enabled".
Then you can open the Java Console using View->Java Console.
|
The System class has quite a few methods that allow you to do more than just print of course.
To read about these methods, simply use the online documentation.
We will talk about how to efficiently use the online documentation a little bit later but you should know that you can find the System class in the java.lang package.
|
NEXT
Selena Sol contributes to the JavaBoutique's Introduction to Java. Selena curently works for Barclays Capital in London, one of the leading global investment banks in Europe and has worked as a software developer for the National Center for Human Genome research, Microline Software, Neuron Data, and Electric Eye in Singapore. Selena is perhaps best-known for creating the Public Domain Web Script Archive (Extropia) and writing several books on Web Programming (Perl, CGI, Java).
Email: selena@extropia.com
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|