Page 23 - CTS - CSA TP - Volume 2
P. 23
COMPUTER SOFTWARE APPLICATION - CITS
EXERCISE 80 : Writing and Executing a simple JAVA
Program to display “Hello”
Objectives
At the end of this exercise you shall be able to
• develop a Simple Java Program
• compile and Execute the Java Program.
Requirements
Tools/Materials
• PC/Laptop with Windows OS
• JDK Software
• Text Editor (Visual Studio/Sublime/Notepad)
Procedure
Step 1: Open a Text Editor:
• Open a text editor such as Notepad, Notepad++, Visual Studio Code, or any other text editor of your choice.
Step 2: Write the Java Code:
Step-by-Step Explanation:
Step 2.1: Define the Class and Main Method:
• Start by defining a class named Hello. In Java, every program needs to be within a class.
• The class name must match the filename (Hello.java).
8