Skip to content

Latest commit

 

History

History
471 lines (349 loc) · 19.8 KB

README.md

File metadata and controls

471 lines (349 loc) · 19.8 KB

🚀 BridgeLabz Java Training — Dev Pratap Singh

A comprehensive Java learning journey from Core Programming to Advanced Java, DSA, OOPs, Design Patterns, JUnit Testing, IO Programming & Multithreading — documented branch by branch.


👤 Author

Dev Pratap Singh 🔗 GitHub: @devps814 📦 Repo: BridgeLabz-Training-Java-Programming


📌 Table of Contents


📖 About This Repository

This repository is a complete log of my Java training at BridgeLabz. It is organized into topic-specific branches, each containing hands-on problem sets, concept explorations, and real-world exercises — progressing from Java fundamentals all the way through to advanced topics like multithreading, design patterns, and test-driven development.

Each branch represents a dedicated learning module. The code follows clean naming conventions and is self-contained with comments explaining the logic.

🔔 Note: This repository is actively growing. New branches for Database, Backend Development, Spring Boot, and more will be added as training progresses.


🌿 Branch Overview

The foundation of the entire Java journey. This branch covers all essential building blocks of Java programming.

Topic What Was Covered
Java Fundamentals Introduction to Java, role of JDK, JRE & JVM, writing first Java program, public static void main
Java Programming Elements Variables, data types (int, float, char, boolean, long), type casting, operators (arithmetic, relational, logical, bitwise, assignment), operator precedence & associativity
Control Flow if, if-else, else-if, switch-case, for, while, do-while loops, nested loops, break & continue
Java Arrays 1D and 2D array declaration & initialization, array traversal, searching (linear, binary), sorting (bubble, selection), array-based problem solving
Java Methods Creating and calling methods, method overloading, return types, passing arguments by value, modular programming
Java Strings String class, string creation (literal vs new), string comparison (equals, ==), common methods: charAt(), substring(), indexOf(), length(), toUpperCase(), toLowerCase()
Built-In Functions Math class (pow, sqrt, abs, round, ceil, floor), Arrays utility class, intro to Java Collections
String Handling Mutable vs immutable strings, StringBuilder & StringBuffer, performance comparison, string reversal & manipulation

🛠️ Tech Stack: Java SE, JDK, Eclipse / IntelliJ IDEA

📚 References:


📂 2. OOps Branch

Deep dive into Object-Oriented Programming — the core paradigm of Java.

Topic What Was Covered
Classes & Objects Defining classes, creating objects, class structure, instance members, real-world object modeling
Constructors Default constructor, parameterized constructor, constructor overloading, use of this keyword
Variables & Modifiers Instance vs static variables, local variables, access modifiers (public, private, protected, default)
Java Keywords static, final, this, instanceof, super — practical examples for each
Inheritance Single & multilevel inheritance, method overriding, super keyword, IS-A relationship
Polymorphism Compile-time (method overloading) and runtime polymorphism (method overriding), dynamic method dispatch
Abstraction Abstract classes, abstract methods, interfaces, implements keyword, difference between abstract class and interface
Encapsulation Data hiding using private fields, getters & setters, JavaBeans convention
UML & Diagrams Object-oriented modelling, class diagrams, understanding relationships — aggregation vs composition vs association

🛠️ Tech Stack: Java SE, OOP Principles, UML Diagrams

📚 References:


📂 3. DSA Branch

Data Structures and Algorithms implemented from scratch in Java — the backbone of problem-solving and technical interviews.

Topic What Was Covered
Arrays & Strings Advanced array manipulation, two-pointer technique, sliding window, string-based DSA problems
Linked List Singly linked list, doubly linked list, circular linked list — insert, delete, traverse, reverse operations
Stack Stack using arrays & LinkedList, push, pop, peek, balanced parentheses, expression evaluation
Queue Simple queue, circular queue, deque (double-ended queue), priority queue
Trees Binary Tree, Binary Search Tree (BST), tree traversals (inorder, preorder, postorder, level-order), height & depth
Sorting Algorithms Bubble sort, selection sort, insertion sort, merge sort, quick sort — time & space complexity analysis
Searching Algorithms Linear search, binary search, recursive binary search
Hashing HashMap, HashSet, collision handling, frequency counting problems
Recursion Recursive thinking, base case & recursive case, factorial, Fibonacci, Tower of Hanoi

🛠️ Tech Stack: Java SE, Java Collections Framework

📚 References:


Advanced Java features that power modern enterprise and functional programming.

Topic What Was Covered
Java Collections Framework ArrayList, LinkedList, HashSet, TreeSet, HashMap, TreeMap, LinkedHashMap, Stack, Queue, PriorityQueue — CRUD operations and iteration
Generics Generic classes, generic methods, bounded type parameters (<T extends ...>), wildcards
Exception Handling try, catch, finally, throw, throws, checked vs unchecked exceptions, custom exceptions
Java 8 Features Lambda expressions, functional interfaces (Predicate, Function, Consumer, Supplier), method references
Streams API stream(), filter(), map(), flatMap(), collect(), reduce(), sorted(), distinct(), limit(), count()
Optional Optional.of(), Optional.empty(), isPresent(), orElse(), orElseGet() — null-safe programming
Date & Time API LocalDate, LocalTime, LocalDateTime, DateTimeFormatter, Period, Duration
Annotations Built-in annotations (@Override, @Deprecated, @SuppressWarnings), custom annotations

🛠️ Tech Stack: Java SE 8+, Java Collections, Streams API, Lambda Expressions

📚 References:


📂 5. JUnit Branch

Test-Driven Development (TDD) using JUnit 5 inside a Maven project — industry-standard Java testing.

Topic What Was Covered
Maven Project Setup Creating Maven project structure (pom.xml), adding JUnit 5 dependency, understanding src/main and src/test
JUnit 5 Basics @Test, @BeforeEach, @AfterEach, @BeforeAll, @AfterAll, test lifecycle
Assertions assertEquals, assertNotEquals, assertTrue, assertFalse, assertNull, assertNotNull, assertThrows
Parameterized Tests @ParameterizedTest, @ValueSource, @CsvSource, @MethodSource
Test Suites Grouping tests, @Tag, running specific test groups
Mocking Concepts Introduction to Mockito, mocking dependencies, @Mock, @InjectMocks, verify()
TDD Workflow Red → Green → Refactor cycle, writing tests before implementation

🛠️ Tech Stack: Java SE, JUnit 5, Maven, Mockito (intro)

📚 References:


Classic software design patterns — the reusable solutions to commonly occurring problems in software design.

Category Pattern What Was Covered
Creational Singleton Only one instance, lazy vs eager initialization, thread-safe Singleton
Creational Factory Method Object creation without specifying the exact class, loose coupling
Creational Abstract Factory Family of related objects without specifying concrete classes
Creational Builder Step-by-step object construction, fluent builder pattern
Structural Adapter Bridge between incompatible interfaces
Structural Decorator Dynamically add responsibilities to objects
Structural Facade Simplified interface to a complex subsystem
Behavioral Observer Event-driven publish-subscribe mechanism
Behavioral Strategy Define a family of algorithms, encapsulate each one, make them interchangeable
Behavioral Iterator Sequential access to elements without exposing underlying structure

🛠️ Tech Stack: Java SE, OOP Principles, UML

📚 References:


File handling, input/output streams, and the power of concurrent programming with Java threads.

Topic What Was Covered
File Handling File class, creating/deleting/renaming files, checking file properties
Byte Streams FileInputStream, FileOutputStream, reading & writing bytes
Character Streams FileReader, FileWriter, BufferedReader, BufferedWriter — reading/writing text files
Serialization Serializable interface, ObjectInputStream, ObjectOutputStream, transient keyword
Java NIO Path, Files, Paths, Files.readAllLines(), Files.write(), Files.copy()
Thread Basics Creating threads via Thread class and Runnable interface, thread lifecycle (New → Runnable → Running → Waiting → Dead)
Thread Synchronization synchronized keyword, race conditions, inter-thread communication (wait(), notify(), notifyAll())
Executor Framework ExecutorService, Executors.newFixedThreadPool(), Future, Callable
Concurrency Utilities CountDownLatch, CyclicBarrier, Semaphore, ReentrantLock

🛠️ Tech Stack: Java SE, Java IO, Java NIO, Java Concurrency (java.util.concurrent)

📚 References:


A dedicated branch for revision, mixed practice problems, and consolidation exercises spanning all topics covered during training.

What's Inside
Revision problems covering Core Java, OOPs, Collections, and DSA
Cross-topic exercises that combine multiple concepts
Mock problem sets for interview preparation
Refactored/cleaned versions of earlier code
Notes and concept summaries

🛠️ Tech Stack: Java SE (all concepts combined)


🛠️ Tech Stack

Tool / Technology Purpose
Java SE 8+ Primary programming language
JDK (Java Development Kit) Compiler (javac) + tools
JRE (Java Runtime Environment) Runs compiled .class files
JVM (Java Virtual Machine) Platform-independent execution engine
Maven Build tool & dependency management (JUnit branch)
JUnit 5 Unit testing framework
Eclipse / IntelliJ IDEA IDE for development
Git & GitHub Version control & code hosting

☕ Setting Up Java (JDK/JRE/JVM)

🔍 Understanding JDK, JRE, and JVM

  Your Java Code (.java)
         ↓
  javac (JDK Compiler)
         ↓
  Bytecode (.class file)
         ↓
  JVM (Java Virtual Machine) — inside JRE
         ↓
  Machine Code (runs on your OS)
Component Full Form Role
JDK Java Development Kit Contains compiler (javac), debugger, tools. You need this to write & compile Java
JRE Java Runtime Environment Contains JVM + libraries. You need this to run Java programs
JVM Java Virtual Machine Converts bytecode to machine code. Makes Java platform-independent

💡 Simple rule: Install JDK — it includes JRE which includes JVM.


📥 Step-by-Step JDK Installation

1. Download JDK

2. Install JDK

  • Run the installer and follow on-screen instructions
  • Note the installation path (e.g., C:\Program Files\Java\jdk-21)

3. Set Environment Variables

Windows:

1. Search "Environment Variables" in Start Menu
2. Under System Variables → click "New"
   Variable name:  JAVA_HOME
   Variable value: C:\Program Files\Java\jdk-21
3. Find "Path" variable → Edit → Add:
   %JAVA_HOME%\bin
4. Click OK → Apply

macOS / Linux:

# Add to ~/.bashrc or ~/.zshrc
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
export PATH=$JAVA_HOME/bin:$PATH

# Apply changes
source ~/.bashrc

4. Verify Installation

java -version
javac -version

You should see the installed version number ✅


▶️ How to Run Java Files

# Step 1 — Navigate to the folder containing your .java file
cd path/to/your/folder

# Step 2 — Compile the Java file
javac FileName.java

# Step 3 — Run the compiled class (no .java extension!)
java FileName

Example:

cd Core_Programming/ControlFlow
javac WhileLoopDemo.java
java WhileLoopDemo

📤 GitHub — Push Your Code

First-Time Setup

# Configure your identity
git config --global user.name "Dev Pratap Singh"
git config --global user.email "your-email@example.com"

Standard Daily Workflow

# 1. Initialize Git (only once per project)
git init

# 2. Connect to your GitHub repository
git remote add origin https://github.com/devps814/BridgeLabz-Training-Java-Programming.git

# 3. Check which branch you're on
git branch

# 4. Switch to / create your working branch
git checkout -b Core_Programming
# or switch to existing branch
git checkout Core_Programming

# 5. Check what files were changed
git status

# 6. Stage all changes
git add .

# 7. Commit with a meaningful message
git commit -m "Add control flow exercises — loops and conditionals"

# 8. Push to GitHub
git push -u origin Core_Programming

Other Useful Commands

# Pull latest changes from remote
git pull origin Core_Programming

# See commit history
git log --oneline

# See difference in changed files
git diff

# Undo last commit (keeps changes)
git reset --soft HEAD~1

# List all branches
git branch -a

🌐 Useful Learning References

📘 Official Documentation

🎓 Learning Platforms

🧩 Practice & Problem Solving

🎨 Design Patterns

📹 Video Resources


🤝 Contributing

  1. Fork this repository 🍴
  2. Create a new branch for your topic: git checkout -b feature/your-topic
  3. Commit your changes with clear messages 📝
  4. Push to your fork and submit a Pull Request 🚀

🙌 Acknowledgements

  • Huge thanks to BridgeLabz for the structured training program and mentorship 🎓
  • Inspired by the Java open-source community and fellow trainees
  • References from Oracle docs, Baeldung, GeeksForGeeks, JavaPoint, and Refactoring Guru

🔮 Coming Soon

As training progresses, the following branches will be added:

Branch (Planned) Topics
Database JDBC, MySQL, SQL queries from Java
Backend Servlet, JSP, REST API basics
SpringBoot Spring Core, Spring Boot, Spring MVC, REST APIs
Hibernate ORM, Entity mapping, HQL

⭐ If you find this helpful, please star the repository! ⭐

Made with ❤️ by Dev Pratap Singh | BridgeLabz Java Training