
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.
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 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 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.
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 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 constructors in Java initialize objects, differentiate default, parameterized and non-parameterized forms, and see how multiple constructors illustrate polymorphism in object creation.
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 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.
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 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.
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.
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.
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.
Master left shift and right shift as essential bitwise operators, apply them to binary numbers, and solve a LeetCode style problem in Java.
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.
Introduces recursion, its base condition, and self-referential calls, illustrated with factorial, recursion tree, and call stack, with hands-on recursion tasks in Java.
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.
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.
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.
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.