Introduction to Java
Brief tour on JGrasp
Menu, Shortcut buttons
Help: Open Java API JavaDoc
The editor
o Colour code
o Auto Indent
Compile & Run
To create a simple Java Program to print out “Hello”
File New Java
Comment:
Starts with //
Colour in green Class name:
Ignored by the compiler Start with capital letter
Information regarding the code Source file is saved as
for easy understanding // The "SayHello" class.
import [Link].*; [Link]
Class file is [Link]
Import packages:
classes in the packages can be public class SayHello main:
used within the program { Where the program starts
public static void main (String[] args) running
{
/* The following line print a line of text to output */
[Link]("Hello");
Matching Brackets } // main method
Brackets defines a block of } // SayHello class [Link]:
code
print the line “Hello”
No nesting
Print multiple lines