Week001 LabEx
Week001 LabEx
1
Introduction to Java Technology
Objective/s:
At the end of this activity, you should be able to:
Deconstruct how a Java program works
Identify the different ways on how to run a simple java program
Procedure:
1. We will be writing a simple java program and try to deconstruct and understand the
different phases of a java program.
a. Open your text editor and type in the following code:
public class FirstLaboratory {
C: Binary data
D: Empty
B: .class
Assessments
C: FirstLaboratory.javaclass
D: FirstLaboratory.javac
B: FirstLaboratory
C: Hello World
2. Open your text editor and change the class name to MyFirstLaboratory, save it and compile.
B: MyFirstLaboratory.class
C: MyFirstLaboratory.class
3. Change the file name of your java code to MyFirstLaboratory, Save and compile.
B: MyFirstLaboratory.class
C: MyFirstLaboratory.class
3. Now change the public static void main to public static void main2. Save it and
compile.
B: FirstLaboratory.java
C: MyFirstLaboratory.java
D: MyFirstLaboratory.class
10: What does the console say? A: This is my first laboratory exercise.
B: FirstLaboratory
C: Nothing
Assessments