0% found this document useful (0 votes)
37 views1 page

01b IntroToJavaV2

JGrasp is an integrated development environment (IDE) for Java programming that provides features like color-coded syntax, auto-indentation, and the ability to compile and run Java code. The document demonstrates how to create a simple "Hello World" Java program in JGrasp by making a new Java file called SayHello.java, defining a public class with a main method that uses System.out.println to print the text "Hello".
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

01b IntroToJavaV2

JGrasp is an integrated development environment (IDE) for Java programming that provides features like color-coded syntax, auto-indentation, and the ability to compile and run Java code. The document demonstrates how to create a simple "Hello World" Java program in JGrasp by making a new Java file called SayHello.java, defining a public class with a main method that uses System.out.println to print the text "Hello".
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

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

You might also like