
Learn how Java works by turning human-readable source code into bytecode, then executing it on the Java Virtual Machine via the Java Runtime Environment. The JDK provides development tools.
Install and set up the JDK on your machine, then install IntelliJ IDEA and create a new Java project. Run the hello world sample to verify the setup.
Write a hello world program in Java by creating a class named main with a public static void main(String[] args) method and printing to the console using System.out.println.
Explore Java primitive data types, including int, float, boolean, char, byte, short, long, and double, and learn how memory size, defaults, and type suffixes (f, l, d) affect usage.
Discover non primitive data types in Java, focusing on strings as a class-based type, how they differ from primitive types and wrapper classes, and common string operations.
Explore variables and constants in Java, learn how to declare and initialize int variables, use the assignment operator and semicolon, and follow naming rules for valid identifiers.
Explore arithmetic operators in Java, including plus, minus, multiply, and divide, with int variables and left-to-right evaluation, and understand operator precedence.
Learn to take input from the user in Java with the scanner class, creating a scanner object and reading integers, strings, and floats, then build a mini calculator.
Master conditional statements in Java by using if-else ladders and boolean expressions, and apply operators like >, <, >=, <=, ==, !=, and/or not in practical voting app examples.
Learn switch statements in java, including case blocks, break to prevent fall-through, and default handling; apply to menu-driven programs using scanner input and simple arithmetic examples.
Explore loops in Java, including for, while, and do-while, with real examples showing when to use each loop and how conditions and counters control repetition.
Explore arrays as a data type that stores a collection of homogeneous elements in contiguous memory, enabling storing multiple values in a single variable in Java.
Learn to create and populate arrays in Java, including integer arrays and index bounds, and printing elements. Explore debugging in IntelliJ and array initialization with braces and length property.
Explore dynamic arrays in Java by taking runtime input with a scanner, populating, printing, summing, and searching elements, and mastering traversal with first and last occurrence techniques.
Explore 2D arrays in Java by defining arrays of arrays, understanding rows and columns, and forming matrices. Practice traversing with nested loops and printing and accessing elements.
Explore the limitations of static arrays and see how dynamic arrays via lists in Java grow automatically, using ArrayList and operations like add and for-each loops.
Learn how Java distinguishes errors from exceptions and handles runtime issues with try-catch blocks for arithmetic and index-out-of-bounds scenarios.
Explore arrays in Java as sequential storage, study time complexity for retrieval, and preview hash maps and sets alongside arrays and array lists usage.
Learn how HashMap stores key-value pairs and enables fast, constant-time lookups in Java. The video demonstrates put and get on maps, and notes that duplicate keys overwrite values.
Discover how sets store unique values by converting an array into a set and relying on ignoring duplicates, as shown with add operations and a hash set of integers.
Define classes and objects in Java, and learn how properties and dot notation create clean, maintainable object oriented programs.
Discover how object oriented programming design enhances modularity, code reuse through inheritance, and polymorphism for flexible behavior, while enabling effective problem solving and interview readiness.
Learn how methods define an object's behavior with properties and actions, including parameterized and return-type methods, and how the this keyword references the calling object.
Learn how constructors in Java initialize objects, differentiate default, parameterized and non-parameterized forms, and see how multiple constructors illustrate polymorphism in object creation.
Learn how data hiding uses private data members and public getters and setters to control access in Java, enhancing readability and security, with practical IntelliJ code generation.
Explain static keyword and static variables, showing how a shared class-level count tracks total users across objects, and how static methods access class data through the class name.
Explore the four pillars of object oriented programming—abstraction, encapsulation, inheritance, and polymorphism. See how they shape Java code and set up upcoming coding demonstrations.
Explore the pillars of oops—abstraction, encapsulation, and inheritance—through Java examples like a person class and a car hierarchy, with constructors, getters, and overriding behavior.
Explore how the abstract keyword and abstract classes prevent direct instantiation of a base class like car, and require subclasses such as Honda to implement abstract methods like start engine.
Explore how interfaces in Java define contracts, enforce overriding methods, and enable multiple interface implementations for a class.
Explore object oriented programming design by building a Java student class that extends Person, manages friends as a bidirectional list, uses getters, setters, and exception handling for access control.
Apply the dry principle by avoiding repeated code and extracting common logic into a single private method, improving maintainability and readability.
Learn the KISS principle—keep it simple, stupid—and YAGNI, meaning you aren’t gonna need it; practice minimal design and build only what is needed.
Explore the five solid principles—single responsibility, open/closed, Liskov substitution, interface segregation, and dependency inversion—through practical examples.
Explore design patterns, focusing on creational patterns and the singleton pattern, which ensures a single database service instance via a private constructor and a getInstance method.
Explore the factory design pattern as a creational pattern that uses a smart factory to create and return the appropriate vehicle (truck, airplane, ship) based on load, enabling delivery.
Explore the builder design pattern in Java, showing how a dedicated builder constructs complex objects like cars, improving code clarity and maintainability when object creation is intricate.
Explore the adapter design pattern, a structural pattern that enables fitting incompatible objects, using square pegs, round holes, and square peg adapters to connect them in Java.
Split a large class into tv and remote control and connect them via the bridge design pattern to improve maintainability and enable modularization with on/off, volume, and source switching.
Learn how the proxy design pattern acts as a substitute for a database service, exposing a proxy layer that wraps get and put data calls to protect underlying data.
Explore the command design pattern within behavioral design patterns by modeling each user action as a command and executing changes to color or tool in a whiteboard app.
Explore the observer design pattern by modeling a YouTube channel as observable and subscribers as observers who receive notifications when the channel publishes new videos.
Learn the iterator design pattern in Java by building a subscriber iterator that traverses a channel's subscribers using hasNext and next, controlled by an index, without exposing the underlying representation.
Define time complexity as runtime with growing input, and space complexity as memory usage; big O is the upper bound, theta the average, omega the lower.
Explore constant time and space complexity, focusing on O(1) behavior where time and space stay fixed regardless of input size, with array examples.
Examine linear time and space complexity (O(n)) as input size changes, using arrays and loops to show how time and memory scale and how constants are ignored.
Define DSA and show how data structures organize information to speed up create, read, update and delete operations through linear and non-linear approaches.
Discover logarithmic time complexity (log n) and how it reduces search space over linear time, illustrated with binary search and a page finding example in java.
Examine quadratic and cubic time and space complexity, illustrate O(n^2) with a two-loop pair-sum algorithm, and review big-O tiers from constant to exponential.
Explore space and time complexity using big O, theta, and omega, including upper and lower bounds; compare constant, linear, logarithmic, quadratic, and cubic growth to guide code optimization.
Explore the basics of decimal and binary number systems in Java, learn how to convert between base ten and base two, and understand why computers operate in binary.
Study bitwise operators and, or, not, xor on the bit level and learn how to determine even or odd numbers using the last bit, faster than decimal operations.
Master left shift and right shift as essential bitwise operators, apply them to binary numbers, and solve a LeetCode style problem in Java.
Count the number of one bits in binary representations for all integers from 0 to n and return a counts array.
Create a converter class that uses bitwise operators to convert decimal to binary by extracting the last bit and right-shifting, building the string result faster than the arithmetic method.
Learn to convert decimal to binary and binary to decimal by looping digits, using two to the power index, and modulus ten, with examples like 1010, 1011, and 1100.
Explore solving LeetCode reverse integer by reversing a signed 32-bit integer using modulus and division by ten, building the result and handling overflow to return zero.
Explore how to determine if a number is a power of two using binary representations and bitwise techniques, comparing iterative and efficient approaches, with a focus on fast, bit-level code.
Learn to compute the complement of a base ten integer by flipping binary bits with bitwise operations and masks, demonstrated with 5→2, 7→0, and 10→5.
Master a naive prime check from two to n, distinguish prime from composite, and apply a simple optimization like testing up to n/2 to reduce time complexity.
Learn to count primes below n, starting with a naive approach and moving to the sieve of Eratosthenes. Use a boolean primes array to mark multiples and count primes efficiently.
Learn to compute the factorial of a number in Java using a for loop and a scanner, multiplying from n down to 1, with examples like 3, 4, and 8.
Introduces recursion, its base condition, and self-referential calls, illustrated with factorial, recursion tree, and call stack, with hands-on recursion tasks in Java.
Learn to compute x to the power n in Java with recursive and iterative approaches, using base cases and a recursive relation, plus draw recursion trees.
Explore linear data structures in Java, starting with arrays and crud operations, then build linked lists, stacks, and queues from scratch, including singly, doubly, and circular variants.
Learn how arrays store similar elements in contiguous memory, using Java primitive arrays and the arrays wrapper class, perform CRUD operations, and compare index-based access (O(1)) with value lookup (O(n)).
Explore how arrays allocate memory in Java, including memory blocks and addresses, why indices start at zero, and how four byte integers map to addresses.
Explore how java's array list acts as a dynamic array with insertion and deletion. See it grow by doubling capacity, copy elements, and build a dynamic array from scratch.
Build a custom integer array class in Java, implement insertions with a current index, and print with stringbuilder for clean output, noting a future dynamic array upgrade.
Implement a linear search to find an element’s index, returning the index or -1 if not present, and optimize by searching only up to the current inserted elements.
Remove an element at a given index from an array by shifting subsequent elements left, analyze best, worst, and average cases, and validate indices to throw an illegal argument exception.
Explore finding maximum and minimum values in an array with Java, using a max function and a min function, and practice ten dry-run examples to reinforce the algorithm.
Reverse an array using a two-pointer in-place swap, achieving O(1) space and O(n) time, with hands-on guidance on index swapping and dynamic resizing.
Learn dynamic arrays by doubling size and copying elements when full. Before inserting, check if the current index equals the array length to avoid array index out of bounds.
Find the single number in an array where every element appears twice, on LeetCode, by implementing a linear time, constant space solution using XOR.
Solve the two sum problem from LeetCode by finding two numbers in an array that add to a target and return their indices, using a hash map for linear time.
Sort colors presents a one-pass, in-place solution for zeros, ones, and twos using a low, high, and i three-pointer scheme to place zeros left and twos right.
Merge the two arrays num1 and num2 into a single sorted array using the first array's extra zeros, then apply a two-pointer approach for O(m+n) time and O(m+n) space.
Learn to move zeros to the end of an array in place, preserving the order of non-zero elements with a two-pointer approach in Java, achieving O(n) time and O(1) space.
Intersect two arrays to find common elements and return unique results. Use a naive approach, then an optimized solution with sorting, two pointers, and a set in java.
Check if an array sorted in descending order is rotated, including zero rotations, by scanning adjacent pairs and the last-to-first pair, counting descending transitions (at most one).
Welcome to the ultimate Java programming course by Piyush Garg — designed for beginners, intermediate learners, and seasoned developers who want to master Java and data structures from the ground up.
In this comprehensive course, we begin with the core fundamentals of Java, covering syntax, object-oriented programming (OOP), and essential design principles like SOLID, DRY, and KISS. Whether you're new to programming or a college student aiming to strengthen your Java skills, this course is your go-to guide. We'll progress gradually, ensuring crystal-clear understanding of each topic.
Java, being the most popular programming language, powers over 90% of Fortune 500 companies, Android applications, and financial systems. Its strong support for OOP makes it the ideal choice for aspiring software engineers.
You’ll also learn to implement and work with both linear and non-linear data structures. In the linear section, we cover Arrays, ArrayLists, LinkedLists, Stacks, Queues, and HashMaps — the building blocks of any efficient program. Then, we dive into advanced topics like Trees (BST, AVL), Heaps (Min/Max), Tries, and Graphs, including key traversal algorithms like DFS and BFS.
This course is packed with coding challenges to help you solidify concepts and prepare for technical interviews and machine coding rounds.
By the end, you’ll be confident in Java and equipped to master Data Structures and Algorithms with ease.