Lab 1: Workshop – Java
Part 1: Creating an eclipse Java project
Step 1: Open Eclipse, select File -> New -> Java Project
Step 2: Provide the project name, set the JDK version and select ‘Finish’
Step 3: Create a new package. Right click on src. Select: New → Package
Write a suitable package name in the new package name dialog box and select ‘Finish’
Package naming conventions
Read the Oracle documentation on package name conventions and write a small paragraph
summarising the naming conventions:
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
Package naming conventions summary:
[Write your summary on the package naming conventions]
Part 2: Writing a simple Java Program
Step 1: Create a new Java Class.
Right click on the package you wish to add the class to. Select: New → Class
Step 2: Create a new class using a suitable class name. E.g., FirstClass.
Select the option to include a public static void main() method. Select finish.
Class naming conventions
Read the documentation that describes the class naming conventions and summarise the
conventions:
https://www.oreilly.com/library/view/java-8-pocket/9781491901083/ch01.html
Class naming conventions summary:
[Write your summary on the class naming conventions]
Step 3: Write a simple program to print “Welcome to CIS5027” into the standard console output.
Step 4: Save the program and run the program.
Right click the .java source file. Select: Run As → Java Application
Step 5: Observe the output in the console tab
Part 3: Java naming conventions
Returning to the documentation from the previous section and comparing it with your notes so far,
write a short one-paragraph description summarising the conventions for package names, class
names, method names, and variable names.
Post your description as a new blog post on the Lab 1 Moodle page, under “Java naming
conventions”.
[Write your summary on the Java naming conventions]
Part 4: Understanding JVM
Read the documentation and related material on JVM and understand the usage, execution and role
of JVM when executing Java programs. Some relevant links are given below.
https://en.wikipedia.org/wiki/Java_virtual_machine
https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-1.html
N.B. You are not expected to understand everything in the JVM specification, but you should try.
Create a one-page summary on your findings and include it as a new blog post on the Lab 1 Moodle
page, under “Understanding the JVM”.
Part 5: Refresh your knowledge and memory on Java syntax, variables, conditional
statements, loops, arrays and methods
Visit the following link and go through the exercises and following the given instructions. You may
use Eclipse IDE, create one or more projects (using part 1 and part 2) to complete these exercises.
https://www.w3schools.com/java/java_exercises.asp