0% found this document useful (0 votes)
5 views3 pages

All Java Experiments

The document outlines three experiments focused on Java programming. Experiment 1 involves setting up the Eclipse IDE and creating a simple Java program, Experiment 2 demonstrates using command line arguments in a Java program, and Experiment 3 covers fundamental Object-Oriented Programming concepts in Java. Each experiment includes objectives, steps, and example code.

Uploaded by

indonasiasv2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

All Java Experiments

The document outlines three experiments focused on Java programming. Experiment 1 involves setting up the Eclipse IDE and creating a simple Java program, Experiment 2 demonstrates using command line arguments in a Java program, and Experiment 3 covers fundamental Object-Oriented Programming concepts in Java. Each experiment includes objectives, steps, and example code.

Uploaded by

indonasiasv2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment No.

-01

Objective:

Use Java compiler and Eclipse platform to write and execute Java program.

Steps:

- Step 1: Install Eclipse IDE


- 1. Download Eclipse: Visit the official Eclipse download page and choose the version suitable for
Java development.
- 2. Install Eclipse: Run the installer and follow instructions.
- Step 2: Install Java Development Kit (JDK)
- 1. Download JDK from Oracle or install OpenJDK.
- 2. Set up JDK in Eclipse via Window > Preferences > Java > Installed JREs.
- Step 3: Create a Java Project in Eclipse
- 1. Go to File > New > Java Project, enter name and click Finish.
- Step 4: Create a Java Class
- 1. Right-click src > New > Class, enter class name and select main method option.
- Step 5: Write Java Code:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
- Step 6: Run using Run button.
- Step 7: Compile and Debug if needed.
Experiment No.-02

Objective:

Creating Simple Java program using command line arguments.

Code:
public class Greet {
public static void main(String[] args) {
if (args.length > 0) {
System.out.println("Hello, " + args[0] + "!");
} else {
System.out.println("Hello, user!");
}
}
}

Expected Output:
> java Greet Harpal
Hello, Harpal!
> java Greet
Hello, user!
Experiment No.-03

Objective:

Understand OOP concepts and basics of Java programming.

Topics Covered:

- Encapsulation: Wrapping data and methods in a class.


- Inheritance: Using extends keyword to inherit from another class.
- Polymorphism: Overriding and overloading methods.
- Abstraction: Hiding implementation details using abstract classes or interfaces.

You might also like