Hands-on Java and DSA practice through small, single-topic programs.
- Syntax and operators
- Control flow (if/else, loops)
- Methods and parameter passing
- OOP essentials (classes, objects, inheritance, interfaces, abstract classes)
- Collections basics (arrays, ArrayList, Vector, Stack)
- Exception handling and basic I/O
- Recursion and pattern-printing exercises
- Java (JDK 17+)
- Any IDE or text editor (e.g. VS Code, IntelliJ IDEA, Eclipse)
- Command line / Terminal
-
Clone the repository:
git clone https://github.com/debug-node/Java-from-scratch.git
-
Navigate into the project folder:
cd Java-from-scratch -
Compile and run Java files. Since the project uses standard Java package structures, compile from the repository root specifying a directory for class files, then run using the fully qualified package class name:
# Compile to an 'out' output directory javac -d out basic/simple/HelloWorld.java # Run using class path and package name java -cp out basic.simple.HelloWorld
-
Alternatively, to run any package file directly via
java(on modern JDKs supporting single-file execution, but note package structure constraints):java basic/simple/HelloWorld.java
The workspace has been organized into clean, categorized, and consistent directories using standard Java package naming and formatting conventions:
Java-from-scratch/
├── basic/ # Basic Java syntax and fundamentals
│ ├── simple/ # Basic templates, greetings, conversions
│ ├── operators/ # Arithmetic and logical operators
│ ├── conditions/ # Conditional logic exercises
│ ├── loops/ # Iterations, pallindromes, tables
│ └── functions/ # Modular reusable methods
│
├── datastructures/ # Fundamental data structures
│ ├── arrays/ # Linear arrays, search and max/min
│ ├── arraylists/ # ArrayLists, Vector, Stack practices
│ └── strings/ # String manipulation algorithms
│
├── algorithms/ # Algorithmic concepts
│ ├── patterns/ # Pyramids, butterlies, and grid prints
│ └── recursion/ # Recursion, fibonacci, and factorials
│
├── oop/ # Object-Oriented Programming principles
│ ├── classesobjects/ # Classes, object instantiation, rectangle calculations
│ ├── inheritance/ # Code reuse, final methods/classes, super calls
│ ├── abstractclasses/ # Abstract templates and specific behaviors
│ ├── interfaces/ # Implementing interface methods and abstractions
│ ├── caloriescalculator/ # Multi-class calories calculator program
│ └── grades/ # Grades-calculation classes
│
├── exceptionhandling/ # Exception handling, try-catch, custom/user exceptions
│
├── packages/ # Java custom packaging and access controls
│ └── mypack/
│
└── assignments/ # Banking, multi-threading, and general calculator systems
Tip: View the live tree anytime (Windows):
tree /F /A- Try writing small Java programs using concepts learned
- Feel free to add your own examples or exercises
- If you find bugs or improvements, submit pull requests
- JDK 17+
- PRs welcome
- debug-node