You are on page 1of 2

BS (Software Engineering) 2023

LAB 1: Introduction to Eclipse, Writing Java programs, Basic


Programming Structure of Java

Objectives
In this lab, you will become familiar with the Eclipse Integrated Development Environment
(IDE), write your first Java program, and understand the basic structure of a Java program.

Theoretical Description
Java is a versatile and widely used programming language known for its portability and
powerful features. Eclipse is a popular IDE that simplifies Java development by providing a
user-friendly environment.

Lab Task
Task 1: Setting Up Eclipse
• Launch Eclipse IDE on your computer.
• Configure your workspace and create a new Java project.
• Familiarize yourself with the Eclipse interface, including the Package Explorer,
Editor, and Console.

Task 2: Writing Your First Java Program


• Create a new Java class called "HelloWorld."
• Write a simple Java program that displays "Hello, World!" on the console.
• Save the file and run the program to verify its output.

Task 3: Understanding the Basic Structure


• Analyze the Java program you wrote in Task 2.
• Identify the main components of a Java program, including the class declaration,
method declaration, and statements.

Task 4: Experimenting with Output


• Modify the Java program to display a different message of your choice.

4
BS (Software Engineering) 2023

• Run the program again to observe the updated output.

Task 5: Comments and Documentation


• Add comments to your Java program to explain its functionality.
• Understand the importance of code documentation for program clarity and
maintenance.

Code Help:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

public class HelloWorld {


public static void main(String[] args) {
System.out.println("Welcome to Java Programming!");
}
}

You might also like