Sunday, March 18, 2012

System.out.print(String)

DOWNLOAD THE CODE: PrintToConsolePkg

We can use a System.out.print(String) to display a prompt
such as "Input a number : "

If we want to make sure that the line is terminated we can use:

Screen shot:
and the output:


The Main method

A Java project many contain many packages and each package may contain many classes. There must be at least one class containing a main method.

The main method is a static method, belonging to the class, where program execution begins - it's the front door, so to speak. The main method begins the chain of events that load the program into memory, ready for use.

In the Java programming language, every application must contain a main method whose signature is:

public static void main(String[] args)


The main method can optionally take a String array as a parameter, as shown in the parenthesis.

(String[] args)


Java API specification

"Overview (Java Platform SE 7 )" ( http://bit.ly/xIonzZ )

Eclipse and Java for Total Beginners



From http://eclipsetutorial.sourceforge.net/totalbeginner.html

Companion document http://eclipsetutorial.sourceforge.net/Total_Beginner_Companion_Document.pdf

What is an IDE?

Download Eclipse IDE

For Windows
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/R/eclipse-jee-galileo-win32.zip

For Mac
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/indigo/SR2/eclipse-jee-indigo-SR2-macosx-cocoa.tar.gz

For full listing visit http://www.eclipse.org/downloads/

What is Java?