Welcome to the ultimate Java learning and practice repository! This collection has been reorganized and enhanced to provide a seamless learning experience, from core concepts to advanced Data Structures and Algorithms (DSA).
The project is divided into two main modules for clarity:
Categorized collection of over 350+ Java snippets reorganized for efficient learning:
basics/: Constructors, OOPS (Inheritance, Polymorphism, Interfaces), Exception Handling, and IO.dsa/: Data Structures & Algorithms (Arrays, Sorting, Searching, Linked Lists, Matrix, Recursion, etc.).advanced/: Advanced features like Streams, Multithreading, Concurrency, Design Patterns, and Mini-projects.practice/: General practice scripts, String challenges, and patterns.collectionframework/: Dedicated module for the Java Collections Framework.
A structured Data Structures and Algorithms pathway based on the Apna College DSA course:
Arrays/,LinkedList/,BinaryTrees/,Backtracking/Recursion/,BitManipulation/,Sorting/,Strings/- And many more industry-standard algorithms.
Running single Java scripts is now easier than ever! No need to worry about packages or complex classpaths.
We provide a simple wrapper script run.ps1 to find and execute any class by its name.
-
Open PowerShell in the project root.
-
Run any class by its name:
.\run.ps1 BinarySearch
This will automatically find, compile, and execute
core-java/src/dsa/search/BinarySearch.java. -
List available categories:
.\run.ps1
If you prefer standard Java commands (requires Java 21+):
# Compile and run from core-java root
javac -d core-java/bin -sourcepath core-java/src core-java/src/dsa/search/BinarySearch.java
java -cp core-java/bin dsa.search.BinarySearch- Small Steps: Start with
core-java/src/basics/to master foundations. - Algorithms: Move to
core-java/src/dsa/or theDSA/root folder for step-by-step challenges. - Practice: Look into
core-java/src/practice/for hundreds of solved problems.
- JDK 21 or higher (Recommended for "Implicit Classes" and Instance Main Methods support).
Happy Coding! ✨