Welcome to my Java Data Structures & Algorithms progress repository! This repository serves as a collection of my notes, code, and problem-solving progress to aid in revision and preparation for interviews.
Java is a high-level, object-oriented programming language known for its platform independence (Write Once, Run Anywhere). It is widely used for building applications, from web to mobile and enterprise systems.
To run Java programs, you need to install the Java Development Kit (JDK). You can download it from:
After installation, verify it using:
java -version
javac -version
On Windows:
Add JAVA_HOME
and PATH
environment variables pointing to the JDK installation directory.
On macOS/Linux:
export JAVA_HOME=/path/to/jdk
export PATH=$JAVA_HOME/bin:$PATH
- Open a text editor or IDE.
- Create a new file with a
.java
extension. Example:Main.java
. - Write your Java code inside the file.
- IntelliJ IDEA:
File -> New Project -> Java
- Eclipse:
File -> New -> Java Project
- VS Code: Install the Java Extension Pack and create a
.java
file.
- Navigate to the directory containing your
.java
file:
cd /path/to/your/file
- Compile the Java file:
javac Main.java
- Run the compiled Java program:
java Main
- Press
Run
orShift + F10
(IntelliJ) - Click
Run
in Eclipse or VS Code
Every Java program must have a class and a main
method. Here's the basic structure:
public class Main {
public static void main(String[] args) {
System.out.println("Hello, Java!");
}
}
Hello, Java!
- Object-Oriented: Uses classes and objects.
- Platform Independent: Runs on JVM across different OS.
- Memory Management: Uses garbage collection.
- Multithreading: Supports concurrent execution.
- Secure: Strong security features.
- Check Java version:
java -version
- Compile multiple Java files:
javac *.java
- Run a Java program:
java ClassName
- Generate Java documentation:
javadoc -d docs Main.java
- Each topic is organized in a separate
folder
for simplicity. - Files are named to match the topic name for easy identification.
Topics covered (Links will be updated as files are added to the repository):
If you find this repo useful, please consider giving it a star ⭐. It helps others discover it too!