This repo is my practice log for the 12-hour Java course by Bro Code. I did not copy-paste anything — every file was hand-typed while watching, so I'd actually build muscle memory for Java syntax, OOP design and problem-solving.
💡 Why hand-type? Reading code teaches you what it does. Typing it teaches you why it breaks.
The repo follows the video's structure, from "Hello World" all the way through OOP, with a mini-project after almost every concept (marked ⭐ in the video).
| 71 lessons in the course |
55 covered so far |
95 Java files |
~3,000 lines hand-typed |
✅ Done: Basics → Control flow → Methods → Arrays → 9 mini-games → Full OOP series 🚧 Up next: ArrayLists, Exception Handling, File I/O, Music Player, Hangman, Threads, Alarm Clock…
Code is split by how I practiced it, not just by topic:
Bro_Code_JAVA_12Hours/
└── src/BroCodeJava/
├── Codes/ → 🧪 Core language concepts (one file per lesson)
├── Projects/ → ⭐ Mini-projects & games that combine those concepts
└── ObjectOriented/
└── Oops/ → 🧱 OOP series — one package per concept, each with its own Main
Codes/— small, focused experiments. Open one, read the comments, run it.Projects/— the "now put it all together" lessons (calculator, banking, slot machine…).ObjectOriented/Oops/— each OOP idea (inheritance, interfaces, composition…) lives in its own package so the helper classes (Animal,Car,Dog…) don't clash between lessons.
Click a lesson to jump to that exact moment in the video. ✅ = typed & pushed, ⏳ = coming soon.
| # | Time | Topic | Code |
|---|---|---|---|
| 1 | 00:00:00 | Introduction to Java ☕ | ✅ |
| 2 | 00:10:58 | Variables ❎ | ✅ variable.java |
| 3 | 00:31:30 | User input ⌨️ | ✅ UserInput.java |
| 5 | 00:54:08 | Arithmetic 🧮 | ✅ ArithmeticOperators.java |
| 7 | 01:09:00 | If statements 🤔 | ✅ ifStatements.java |
| 8 | 01:22:28 | Random numbers 🔀 | ✅ RandomClass.java |
| 9 | 01:27:28 | Math class 📐 | ✅ MathCLass.java |
| 10 | 01:42:37 | printf 🖨️ | ✅ printf.java |
| 12 | 02:03:47 | Nested if statements 🎟️ | ✅ nestedif.java |
| 13 | 02:10:20 | String methods 🧵 | ✅ StringMethods.java |
| 14 | 02:18:55 | Substrings 📧 | ✅ substring.java |
| 16 | 02:35:19 | Ternary operator ❔ | ✅ ternaryOperator.java |
| 18 | 02:49:05 | Enhanced switches 💡 | ✅ EnhancedSwitches.java |
| 20 | 03:09:58 | Logical operators ❕ | ✅ logicalOperators.java |
| # | Time | Topic | Code |
|---|---|---|---|
| 21 | 03:21:23 | While loops ♾️ | ✅ whileLoops.java |
| 23 | 03:43:33 | For loops 🔂 | ✅ forLoop.java |
| 24 | 03:53:33 | Break & continue 🚦 | ✅ breakContinue.java |
| 25 | 03:55:45 | Nested loops ➿ | ✅ nestedLoop.java |
| 26 | 04:04:27 | Methods 📞 | ✅ Methods.java |
| 27 | 04:19:51 | Overloaded methods 🍕 | ✅ OverLoadedMethods.java |
| 28 | 04:25:59 | Variable scope 🏠 | ✅ VariableScope.java |
| 31 | 05:03:26 | Arrays 🍎 | ✅ array.java |
| 32 | 05:12:35 | Enter user input into an array ➡️ | ✅ UserInputArray.java |
| 33 | 05:20:38 | Search an array 🔎 | ✅ searchInArray.java |
| 34 | 05:28:07 | Varargs 💬 | ✅ varargs.java |
| 35 | 05:34:36 | 2D arrays ⬜ | ✅ arrays_2d.java |
Each one is runnable and interactive in the console.
| # | Time | Project | Code |
|---|---|---|---|
| 4 | 00:47:25 | ⭐ Mad Libs game 📕 | ✅ MadLibsGame.java |
| 6 | 01:02:29 | ⭐ Shopping cart program 🛒 | ✅ Exercise2.java |
| 11 | 01:56:14 | ⭐ Compound interest calculator 💸 | ✅ CompoundInterestCalculator.java |
| 15 | 02:27:00 | ⭐ Weight converter 🏋️ | ✅ WeightConverter.java |
| 17 | 02:41:10 | ⭐ Temperature converter 🌡️ | ✅ TemperatureConverter.java |
| 19 | 02:57:42 | ⭐ Calculator program 🖩 | ✅ Calculator.java |
| 22 | 03:33:47 | ⭐ Number guessing game 🔢 | ✅ NumberGuessingGame.java |
| 29 | 04:30:57 | ⭐ Banking program 💰 | ✅ BankingProgram.java |
| 30 | 04:51:26 | ⭐ Dice roller program 🎲 | ✅ DiceRollerProgram.java |
| 36 | 05:44:13 | ⭐ Quiz game 💯 | ✅ JavaQuizGame.java |
| 37 | 05:59:14 | ⭐ Rock paper scissors 🗿 | ✅ RockPaperScissors.java |
| 38 | 06:15:02 | ⭐ Slot machine 🎰 | ✅ SlotMachine.java |
Each concept is its own package under src/BroCodeJava/ObjectOriented/Oops/.
| # | Time | Topic | Code |
|---|---|---|---|
| 39 | 06:41:47 | Object-oriented programming 🧱 | ✅ Oops1.java |
| 40 | 06:51:38 | Constructors 🔨 | ✅ Constructor/ |
| 41 | 07:01:45 | Overloaded constructors 🛠️ | ✅ OverloadConstructors/ |
| 42 | 07:08:22 | Array of objects 🗃️ | ✅ Array_Of_Objects/ |
| 43 | 07:14:07 | Static 🤝 | ✅ Static/ |
| 44 | 07:22:04 | Inheritance 👨👧👦 | ✅ Inheritance/ |
| 45 | 07:31:09 | Super 🔝 | ✅ Super/ |
| 46 | 07:41:37 | Method overriding ♻️ | ✅ Method_Overriding/ |
| 47 | 07:46:08 | toString method 🎉 | ✅ ToString/ |
| 48 | 07:51:58 | Abstraction 🌫️ | ✅ Abstraction/ |
| 49 | 08:01:30 | Interfaces 📋 | ✅ Interface/ |
| 50 | 08:07:44 | Polymorphism 🎭 | ✅ Polymorphism/ |
| 51 | 08:14:27 | Runtime polymorphism 🤷♂️ | ✅ RuntimePolymorphism/ |
| 52 | 08:19:35 | Getters and setters 🔐 | ✅ GettersAndSetters/ |
| 53 | 08:29:39 | Aggregation 🏫 | ✅ Aggregation/ |
| 54 | 08:39:02 | Composition ⚙️ | ✅ Composition/ |
| 55 | 08:45:17 | Wrapper classes 🎁 | ✅ WrapperClasses/ |
| # | Time | Topic | Status |
|---|---|---|---|
| 56 | 08:55:51 | ArrayLists 📃 | ⏳ |
| 57 | 09:05:29 | Exception handling |
⏳ |
| 58 | 09:13:28 | Write files ✍ | ⏳ |
| 59 | 09:21:58 | Read files 📖 | ⏳ |
| 60 | 09:28:50 | ⭐ Music player 🎼 | ⏳ |
| 61 | 09:43:10 | ⭐ Hangman game 🕺 | ⏳ |
| 62 | 10:11:42 | Dates & times 📆 | ⏳ |
| 63 | 10:20:24 | Anonymous classes 🕵️♂️ | ⏳ |
| 64 | 10:25:23 | TimerTasks ⏲️ | ⏳ |
| 65 | 10:31:45 | ⭐ Countdown timer ⏳ | ⏳ |
| 66 | 10:38:16 | Generics 📦 | ⏳ |
| 67 | 10:52:09 | HashMaps 🗺️ | ⏳ |
| 68 | 11:02:38 | Enums 📅 | ⏳ |
| 69 | 11:12:45 | Threading 🧵 | ⏳ |
| 70 | 11:23:04 | Multithreading 🧶 | ⏳ |
| 71 | 11:31:02 | ⭐ Alarm clock ⏰ | ⏳ |
You need two things: a JDK and an editor/IDE.
☕ JDK 25 or newer (important!)
Most files here use the short form static void main(String[] args) — no public, no String[] ceremony required — which is only valid from Java 25 onward. On older JDKs (8, 11, 17, 21) you'll get "Main method not found" errors. This repo was written with JDK 26 in IntelliJ.
Check what you have:
java -versionNo JDK? Install one from any of: Oracle JDK · OpenJDK · Adoptium Temurin
🖥️ An IDE (pick one)
| IDE | Best for | Download |
|---|---|---|
| IntelliJ IDEA ⭐ (what I used) | Zero-setup Java; run with one click | jetbrains.com/idea (Community is free) |
| VS Code | Lightweight; needs the Java extension | code.visualstudio.com + Extension Pack for Java |
| Eclipse | Classic Java IDE | eclipse.org |
| Terminal only | No IDE at all | Just the JDK from above |
git clone https://github.com/HBCoder31/Bro_Code_JAVA_12Hours.git
cd Bro_Code_JAVA_12Hours🟠 IntelliJ IDEA (recommended)
- Open IntelliJ → File → Open… → select the cloned
Bro_Code_JAVA_12Hoursfolder. - Go to File → Project Structure → Project and set the SDK to JDK 25+ (the project already marks
src/as the source root). - In the Project panel, open any file, e.g.
src/BroCodeJava/Projects/SlotMachine.java. - Click the green ▶ next to
main, or press Shift + F10. - Interactive programs read input from the Run console at the bottom — just click it and type.
🔵 VS Code
- Install the Extension Pack for Java.
- File → Open Folder… → select
Bro_Code_JAVA_12Hours. - Make sure VS Code uses JDK 25+: open the Command Palette (
Ctrl/Cmd + Shift + P) → Java: Configure Java Runtime. - Open any file in
src/and click Run abovemain(or pressF5). - For programs that ask for input, choose Integrated Terminal when prompted so you can type responses.
⚫ Terminal (any OS, no IDE)
Run from the repo root. Files are in packages, so use the fully-qualified class name:
# Compile everything into an `out/` folder
javac -d out $(find src -name "*.java") # macOS / Linux / Git Bash
# Run any program
java -cp out BroCodeJava.Projects.SlotMachine
java -cp out BroCodeJava.Codes.StringMethods
java -cp out BroCodeJava.ObjectOriented.Oops.Inheritance.InheritanceOn Windows PowerShell, compile with:
javac -d out (Get-ChildItem -Recurse -Filter *.java src).FullNameSeveral OOP packages each have their own
Car/Animal/Dogclasses — that's intentional. Because they live in separate packages, compiling the whole tree works fine.
| Problem | Fix |
|---|---|
Error: Main method not found in class … |
Your JDK is older than 25. Install JDK 25+ and point your IDE to it. |
package … does not exist / red underlines in IntelliJ |
Mark src as Sources Root (right-click src → Mark Directory as → Sources Root). |
| Console input doesn't work in VS Code | Run in the Integrated Terminal, not the Debug Console. |
javac is not recognized |
Add the JDK's bin/ folder to your PATH, then reopen the terminal. |
If you want a quick tour, run these and play:
| Program | Why it's fun |
|---|---|
SlotMachine.java |
Bets, symbols and payouts — combines loops, methods & randomness |
BankingProgram.java |
Menu-driven deposit / withdraw / balance app |
RockPaperScissors.java |
Play against the computer |
NumberGuessingGame.java |
Higher / lower with attempt counting |
JavaQuizGame.java |
Multiple-choice quiz with scoring |
- 🔹 Java syntax, types, operators and formatted output
- 🔹 Control flow:
if,switch(enhanced), ternary, loops,break/continue - 🔹 Methods, overloading, varargs and variable scope
- 🔹 Arrays (1D & 2D), searching, and handling user input with
Scanner - 🔹 The four pillars of OOP — encapsulation, inheritance, polymorphism, abstraction — plus aggregation vs composition
- 🔹 Building small console apps end-to-end
All lessons, structure and exercise ideas belong to Bro Code. 👉 Java Full Course for free ☕ (12 hours) — go watch it and give him a ❤️.
This repo is my personal, hand-typed practice of that course and is not affiliated with Bro Code.