
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Master java programming from installation and basics to oops principles and collections, then explore modern features like jshell, text blocks, switch expressions, and virtual threads.
Discover what Java is as a widely used programming language for building web and mobile apps, backend APIs, and production-ready software, with security, portability, and performance at its core.
Follow a step-by-step approach to learning Java, starting with alphabets and keywords, then mastering syntax and statements to build web, mobile, and backend applications.
Learn to print your name with a java statement using jshell, the java 9 repl tool. Explore the hello world tradition and the System.out.println syntax, with jshell providing immediate feedback.
Trace the history of Java from its 1995 release by Sun Microsystems to modern six-month release cycles and the JDK ecosystem, including LTS versus non-LTS distinctions.
Explore why multiple JDK vendors exist in the Java ecosystem, from OpenJDK and Oracle JDK to Adopt JDK, Amazon Corretto, and Azul, and how the TCK ensures consistent behavior.
Install Java efficiently with sdkman on mac, linux, and unix, choosing Amazon Corretto and other JDKs. Learn to list, install, and verify JDK versions, and understand environment setup.
Install Java on Windows using the Amazon Corretto installer, which automatically configures JAVA_HOME, and verify the installation with java -version.
Install and verify Java on your system. Launch jshell and practice basics with println statements, then learn shortcuts to exit jshell and prepare for core Java concepts.
Learn the fundamentals of Java keywords, case sensitivity, and safe variable naming, including why not to use reserved words and how to avoid hard coding.
Explore the eight primitive data types in Java: boolean, char, byte, short, int, long, float, and double, and learn why primitive types improve storage and performance.
Explore Java's primitive data types—boolean, char, byte, short, int, long, float, and double—covering sizes, defaults, and when to use them for whole and decimal numbers.
Learn to store data with primitive data types in Java by using syntax for declaration and initialization, with literals for boolean, int, and double.
Explore declaring primitive data types and storing data in Java—boolean, int, double, and char—via jshell demos, covering default values, initialization, and common pitfalls.
Learn to name Java variables with camel case, start with a letter, and use meaningful identifiers. Follow rules about allowed characters and reserved words to improve readability.
Master case styles for clear variable naming by exploring camel case, pascal case, snake case, and kebab-case, applying these conventions across Java, JavaScript, and other languages for readable code.
Learn how the boolean primitive in Java stores true or false to express on/off and yes/no states, with guidance on declaration, initialization, and readable naming like is/has.
Explore the char primitive in Java, its 16-bit Unicode representation, declaring variables, and using Unicode escapes and the Character class for digit and case checks.
Demonstrate declaring and initializing char variables, printing characters, and using Unicode values with \uXXXX, including decimal representations and symbols like the pound sign and emoji.
Explore escape sequences in the char data type, including the backslash n for a new line and doubling the backslash to print a backslash, plus isLowerCase and isDigit from Character.
Explore the primitive integer types—byte, short, int, and long—learn when to use each, L suffix for long literals, and how to find min/max values via Byte, Short, Integer, and Long.
Explore how to work with byte, short, int, and long primitive data types in Java, including min/max values via wrapper classes and the importance of the long suffix.
Explore overflow and underflow in Java as arithmetic on int ranges beyond max value and min value, which wraps around; learn to avoid it by using long for safer results.
Explore float and double in Java, covering their 4-byte and 8-byte sizes, precision (7 vs 15 digits), default types, and suffix usage, plus BigDecimal for higher precision.
Explore float and double primitives in Java, including f suffix literals and min/max values, and compare precision: float about 7 digits versus double about 15 digits for financial transactions.
Master how float and double handle positive zero, negative zero, infinity, and NaN, compare values, and apply casting when combining double with int for accurate decimals.
Explore how to use underscores in numeric literals across int, float, double, byte, short, and long to improve readability, with Java 7 rules and compiler behavior.
Explore how Java stores integers in octal, hexadecimal, and binary formats. Use prefixes 0, 0x, and 0b and learn when to apply each.
Demonstrate the octal number format in Java with a leading zero and at least two digits, and show 346 converting to 230 in decimal via powers of eight.
The lecture demonstrates the hexadecimal number format in Java, using a 0x prefix and digits 0-9 and a-f, converting 1A3 to decimal 419 while covering validation for invalid digits.
Learn how to declare binary numbers in Java with a 0b prefix, validate digits 0 and 1, and convert 1101 to its decimal value using powers of two.
Mastering modern Java programming: beginner to pro cover typecasting in Java, distinguishing widening (implicit) casting from narrowing (explicit) casting, with examples using int, double, float, and boolean restrictions.
Demonstrates implicit and explicit casting in Java, showing widening from int to double without data loss, and narrowing from double to float or int with explicit casts and data loss.
Explore explicit and implicit casting in java with scenarios from long to int downgrades, char to numeric conversions, and how manual casting avoids or causes overflow and precision loss.
Explore how strings store text in Java, why String is a reference data type rather than primitive, and how to declare, initialize with null, and use double quotes. Understand memory allocation for String at runtime and guard against NullPointerException while handling text data.
Explore the String data type in Java, covering declaration, initialization, null values, and the use of double quotes. Understand why String is a reference type and how to store data.
Four-step life cycle of a Java program—from writing .java source in a class, to compilation with javac and bytecode, to running on the JVM across operating systems.
Explore how the JDK, JRE, and JVM relate: the JDK bundles dev tools and JRE, while the JVM runs bytecode; Java 9 removed standalone JRE to simplify installations.
Explore the Java program life cycle from writing MyClass.java to running MyClass via the JVM, including javac, .class bytecode, and write-once, run-anywhere.
Trace the Java program life cycle from source code to bytecode and the JVM, explaining compilation, interpretation, and the role of just-in-time compilation in platform-independent execution.
Explore the Java life cycle and its core components—JDK, JVM, and JRE—clarifying platform independence, how the JVM enables it, and how JRE and jlink relate to running Java apps.
Move from jshell to writing Java programs in files by creating a .java source with a public class named after the file. Implement a main method for the JVM.
Write your first Java program in HelloWorld.java, ensure the class name matches the file name, compile with javac, and run with Java to see Hello World on the JVM.
Java 11 introduces launch single file source code program, enabling compile and run with one command. Java 22 adds launch multi file source code program for multi-file projects.
Introduce compact source files and instance main methods in Java 25 to ease beginners. Show main method variants and string array args, and print with println while noting production syntax.
Compare text editors and jshell, then explore how an IDE like IntelliJ IDEA integrates with Git, Maven, and Spring to boost productivity, debugging, and code quality in Java projects.
Set up IntelliJ IDEA to create a new Java project named Hello World, configure the Amazon Corretto 25 JDK, and save code under the Skrr source folder.
Explore writing your first Java class in IntelliJ using compact file, introduced in Java 25, and the traditional main method, while configuring the sdk and using psvm and println shortcuts.
Explore how to define Java classes, create objects, and use methods, fields, and constructors within a practical object oriented programming framework.
A Java class serves as a blueprint for objects, defining state and behavior. It uses instance variables and methods, with public, constructors, and inner classes.
Create new java classes in a workspace using IntelliJ, starting with section4 and a Car class, and verify lowercase naming, .java extension, and the optional public modifier.
Declare fields inside a Java class to store properties like model, color, and year, following the syntax: optional modifier, data type, camel case name, optional initializer, and a semicolon.
Declare fields in a Java class by defining instance variables like model, color, horsepower for Car and firstName, lastName, age, gender for Employee using appropriate data types.
Define methods inside a class to represent object behavior and enable callable blocks of code. Specify a public modifier, a return type, a camel case name, and parameters.
Learn to define a Java method with public modifiers and an int return type, implement sum of two numbers using parameters and arguments, and understand method body syntax.
Explore how to add non-static methods to a Car class, including startCar with void, stopCar returning a String, using public modifiers, empty parameters, and System.out.println for output.
Create Java methods in an employee class, implement getAge and getGender as getters (byte and char), fix a duplicate method error, and add ArithmeticOperations with a sum method returning int.
Discover how a Java method signature uniquely identifies methods by name, number and types of parameters, and their order, while parameter names, modifiers, and return types do not.
Learn how the return statement transfers control to the caller in Java, returning expressions like num1 + num2 or a hard coded int, and why void methods return nothing.
Understand the syntax for invoking Java methods, including static versus non-static calls, and how to pass arguments like 6 and 24 using an object or a class name.
Explain the public static void main(String[] args) method, why public and static matter for the JVM, and show Hello World output and signature variations.
Create the first Java object from the Employee class in EmployeeMain, set fields, and call getAge and getGender to print results, then explore the default constructor and decompilation concepts.
Understand how a constructor initializes a Java object using the new keyword. See how the name must match the class, no return value, and how overloading supports multiple constructors.
Demonstrate how Java constructors are invoked during object creation, explain default versus defined constructors, and introduce debugging with breakpoints, stepping, and running in IDEs like IntelliJ.
Initialize object fields inside the constructor with this to set firstName, lastName, age, and gender, avoiding hardcoded values, and use constructor overloading to pass varying data at creation.
Learn constructor overloading in Java by adding a parameterized constructor for firstName, lastName, age, and gender, and understand why a default constructor is not auto-generated.
Learn constructor chaining in Java by invoking one constructor from another with this, using default and overloaded constructors in an Employee class while avoiding recursion and multiple invocations.
Learn why Java constructors cannot return values or declare a return type, and why using a bare return is allowed but discouraged; distinguish warnings from errors with practical IntelliJ examples.
Explore instance initialization blocks in a Java class to initialize object fields during creation. See how multiple blocks run in order, alongside constructors, via a Car class demo.
Understand how Java uses an instance initialization block alongside constructors to initialize objects, reduce duplicate code, and support anonymous classes, as shown in the car example.
Learn how static variables belong to the class and are shared by all objects, with the JVM storing them in the class area and object data in the heap.
Explore static variables in Java with Car and Employee classes, showing how class-level fields like numberOfWheels and employerName are shared across all objects and accessed via the class name.
Define static final variables to prevent runtime changes, using snake case for constants like NUMBER_OF_WHEELS and EMPLOYER_NAME; the Car and Employee examples show a compilation error when reassigned.
Differentiate static variables from instance variables in Java: static fields are shared by all objects and initialized once when the class loads, while each object has its own instance field.
Explore how static methods provide utility logic that doesn't rely on object state and are invoked as ClassName.method(args), with main() as a built-in static example.
Discover how to create and use static methods in Java, compare static and non-static methods, and learn to access static and instance variables from main with practical examples.
Explore how to invoke static and non-static methods in Java across classes, using class names for static calls and objects for instance calls, with practical demos.
Learn how static initialization blocks initialize static variables at class load time, execute before main, and run once, with multiple blocks in order and distinctions from instance initializers.
Learn how static initialization blocks work in Java with a Car example. A numberOfEngines initializes to 1, and the static block runs once when the Car class loads, before main.
Explore how to debug Java method invocations in IntelliJ, using breakpoints, step over, step into, and step out, to trace static and instance methods through a stack-based LIFO flow.
Understand how the JVM manages memory, including heap for objects and the garbage collector, stack for local variables and calls, and the method area and native heap for code.
Understand how stack memory and heap memory handle Java objects—main creates e1, e2, e3 in the heap while references reside on the stack, with garbage collection reclaiming unused objects.
Demonstrates heap memory and stack memory in IntelliJ through a CarMain example, showing object creation, loading classes, and debugging to identify memory usage and potential leaks.
Explore how null denotes absence of an object in Java reference types, with examples using String and Employee, and learn why null checks prevent NullPointerException.
Explore how Java creates objects with new and constructors, and how the garbage collector automatically manages memory without manual destruction. Learn about different collectors, System.gc usage, and interview implications.
Compare class, object, instance, and reference in Java, clarify their distinct meanings, and explore how objects are created with a blueprint, the new operator, and constructors.
Explore encapsulation in Java by grouping fields and methods into a class and controlling access with private, protected, and public modifiers.
Learn how comments in Java provide explanatory notes to code, including single line, multi-line, and Javadoc styles, which the JVM ignores during compilation.
Learn how to use single line comments in Java with // to document code, explain variables, and safely comment out lines without breaking statements.
Master single line comments in Java with a hands-on demo, showing how to annotate variables and methods and how the compiler ignores comments while clarifying code intent.
Master multi line comments in Java, using /* and */ to document classes, methods, and variables or temporarily disable code in the middle of a file.
Demonstrate multi-line comments in Java by documenting a Customer class and a calculateRectangleArea method, and illustrate using /* ... */ for inline and block comments with readability tips.
Explore javadoc comments in Java and how the javadoc tool generates HTML documentation. Learn syntax, placement, and tags like @code, @link, and @since with practical examples.
Explore creating a Java class and writing javadoc comments with tags like @since and @author, using IntelliJ. Learn to use @param, @return, @see, @link, and HTML elements to generate documentation.
Learn to write javadoc comments for a two-parameter sum method in Java, using IntelliJ shortcuts to generate and customize @param and @return tags and build HTML docs from JavaDocCommentsDemo.
Generate HTML documentation from Javadoc comments in IntelliJ using the Generate JavaDoc tool, selecting the file or project scope and an output directory, and view the rendered HTML.
Explore section six by creating a new IntelliJ Java project and examining how primitive types and the String reference type store data, with a focus on String methods.
Explore the string pool concept in Java, compare literal strings versus new operator objects, and learn string interning, memory optimization, and performance benefits.
See how string literals and new String() demonstrate the string pool, and compare their memory locations with hashCode and the == operator.
Explain how the String.intern() method interns strings into the string pool, enabling shared memory for identical content and true equality with the == operator.
Discover string concatenation in Java using the plus operator and the concat() method, including adding space characters, and compare empty versus null strings and string immutability.
Learn to store data with quotes in Java strings using escape sequences, and embed Unicode characters with \u codes, illustrated by Madan!
Explore the string length method to determine the total number of characters in a string, including spaces and Unicode units, with examples like hello and world.
Compare string contents using equals and equalsIgnoreCase, showing how new String objects and literals affect memory locations versus content, and when to use double equals versus content comparison.
Explore string comparison in Java using equals, equalsIgnoreCase, and compareTo to sort strings lexicographically in ascending or descending order. Learn how 0 means equal and negatives or positives indicate order.
Master the charAt() method to fetch a character by its zero-based index in a Java String, understand length, and handle invalid indices that throw StringIndexOutOfBoundsException.
Learn how to check if a string is empty in Java using isEmpty, length, and equals, with safe null handling and isBlank differences.
Explore how to convert a string to upper or lower case with toUpperCase and toLowerCase, and use Locale to handle language-specific rules.
Learn to convert int, double, boolean, and char values to String representations using String.valueOf() or the concatenation operator, with demos in ConvertStringDemo.
Explore four string search approaches in Java - indexOf, contains, startsWith/endsWith, and matches with regular expressions - learn how -1 indicates no match and how to handle case sensitivity.
Master the trim() method to remove leading and trailing spaces and control characters from strings, learn what gets trimmed, and see practical demos in Java.
Explore substring in Java: use String.substring() to extract a string portion with start index inclusive and end index exclusive, via two overloads, returning a new string and preserving the original.
Explore string replacement in Java by using replace(), replaceAll(), and replaceFirst() to swap characters or substrings via overloaded methods, with regex-based and case-sensitive variations, and practical examples.
Learn to split a string with the split() method into a String[] array using a delimiter. See a Java fruit example with comma separation and zero-based indexing.
Learn how to join multiple strings into a single string using the Java 8 join() static method, with custom delimiters and varargs inputs, including lists, efficiently backed by StringBuilder.
Explore how the static format() method in the String class replaces placeholders like %s, %d, %f, %c, and %b with dynamic values. Create personalized messages with precise prices and alignment.
Learn how System.out.printf formats strings with placeholders and dynamic values, replacing %s, %d, %f, %c, %b, and ensure newline with %n, in contrast to println and print.
Explore string immutability in Java, where string objects cannot be changed and reassignment creates new objects, while the final keyword prevents modification and StringBuilder or StringBuffer provide mutability.
Explore mutable strings in Java using StringBuilder, StringBuffer, and CharArrayWriter, with append, insert, reverse, and toString operations, and learn when to use each for thread safety.
Demonstrate mutability of strings in Java with StringBuilder, StringBuffer, and CharArrayWriter, using append, insert, deleteCharAt, setLength, reverse, toString, and IOException handling.
Explore text blocks in Java 15 to store multi-line strings with triple quotes. Learn how text blocks preserve formatting and newlines, and how to use them with format() placeholders.
Explore converting strings to primitive types using wrapper parse methods like parseInt and parseBoolean, and learn string to primitive conversions with valueOf, and character parsing via charAt or toCharArray.
Convert strings to primitive values in Java using wrapper parse methods such as Integer.parseInt, Double.parseDouble, Float.parseFloat, Long.parseLong, and Boolean.parseBoolean, plus char extraction with charAt or toCharArray.
Explore Java operators and operands through a puppet show analogy, learn how plus and equals perform addition and assignment, and see how literals and variables act as operands.
Explore Java operator categorization by operand count—unary, binary, and ternary—with prefix and postfix forms, and by operation type—arithmetic, relational, logical, and bitwise.
Explore how Java expressions are built from literals, variables, method invocations, and operators to produce a result, and learn how assignment and other operators combine primary expressions.
Explore the Java assignment operator, a binary right associative operator that assigns values from right to left, including chained expressions like a = b = 98.
Explore how the assignment operator works in Java, highlighting left-hand side variable rules, primitive vs reference types, and how object references share memory, with declarations, initialization, and assignment explained.
Explore Java arithmetic operators, including binary add, subtract, multiply, divide, and modulus. Understand unary plus/minus, pre/post increment and decrement, and compound assignment with numeric types, including char.
Explains the addition operator's dual role for numeric addition and string concatenation, and outlines type promotion to double, float, long, or int, plus unary minus and byte casting.
Explain how the addition operator reconciles double and int, highlighting constant expressions like 5+3, casting rules, and byte range limits, with notes that these rules extend to other operators.
Explore how the plus operator becomes string concatenation when a string is involved, how left associativity and parentheses shape outputs like 6 goals and 42 goals, and how nulls behave.
Explore division and modulus operators in java, including integer division with truncation, floating-point division, quotient and remainder, and edge cases like division by zero, infinity, and NaN.
Explore how Java's modulus operator returns the remainder and governs integer and floating-point rules, including denominator zero, NaN, infinity, and sign behavior.
Explore unary plus and unary minus, how they promote byte, short, and char to int, how typecasting fixes downcasting, and how two negations yield a positive value.
Learn how compound arithmetic assignment operators in Java perform in-place updates, auto cast results, and handle numeric and string cases with plus equals, including practical examples.
Master the increment and decrement operators in Java, including prefix and postfix forms, and understand how they modify variables by one within expressions and loops.
Explore postfix and prefix increment and decrement in Java through puzzles that reveal how num updates and how expressions evaluate by the JVM.
Explore relational operators in Java: six binary operators that compare two operands and return boolean results, including ==, !=, >, <, >=, and <=, with instance of coming later.
Understand the equality operator (==) in Java by comparing two operands of the same type, distinguishing primitive value comparison from reference identity, and noting equals() for strings.
Master how Java's equality operator evaluates left to right and why type mismatches occur. Fix with parentheses and the logical and operator, and understand isNaN, zero, and infinity rules.
Explore the inequality operator in Java, the opposite of the equality operator, with syntax using != and practical examples across int, boolean, and double types, including NaN and infinities rules.
Understand the greater than, greater than or equal, less than, and less than or equal operators in Java, their use with primitive numeric types, and NaN behavior.
Master how boolean operands drive Java logical operators, including unary not (!) and binary short-circuit &&, ||, &, and xor (exclusive OR), with boolean outputs and non-boolean errors.
Learn how the logical not operator in Java negates a boolean operand, returning the opposite value, using an exclamation mark with literals, variables, or expressions.
Master the logical short-circuit and logical AND operators in Java, learn syntax with && and &, understand how the left-hand true/false affects evaluation, and review code examples with booleans and numbers.
explain how the logical short-circuit and operator (&&) evaluates left and right operands in Java, comparing it to the logical and operator (&), and show performance benefits.
Explain the logical short-circuit or and the logical or operators in Java, including || and | syntax, how true operands yield true, and right-hand evaluation rules.
Explore how the logical short-circuit OR (||) evaluates the left condition first, prevents right-hand side execution, and differs from the non-short-circuit |, with Java demos and real-world business scenarios.
Explore the logical xor (exclusive or) operator in Java, using the caret symbol ^, with rules that same values produce false and different values produce true, and no short-circuit behavior.
Learn how compound logical assignment operators work in Java, using operand1 with and, or, and xor via &=, |=, and ^=. Java omits short-circuit forms.
Explore bitwise operators in Java and perform operations at the bit level on integer operands, including and, or, xor, not, shifts, and compound assignment variants.
Apply the bitwise not operator in Java to flip every bit of an int value, converting nine to negative ten via two's complement, with tilde as the operator symbol.
Understand how the bitwise and operator uses the ampersand to compute 10 & 6 in binary, producing 2, and how two int operands determine between bitwise and and logical and.
Master the bitwise OR operator in Java by converting decimals to binary, applying the OR on int operands such as 10 and 6 to yield 14, and validating with code.
Master the bitwise xor operator in Java, a binary operator that outputs one when bits differ and zero when they are the same, with 10 ^ 6 giving 12.
Master the left shift operator in Java, a binary operator that shifts the left operand by the right operand, with 10 << 2 yielding 40 and power of n shortcut.
Explore the signed right shift operator in Java, a binary operator that preserves the sign when right shifting, contrasting it with the unsigned right shift, illustrated with 50 and -50.
Explore the unsigned right shift operator, which fills left bits with zeros and ignores the sign. Observe that shifting the value 10 by 2 yields 2, illustrating zero extension.
Explore compound assignment bitwise operators in Java, detailing syntax, casting, and how operand1 op operand2 translates in jvm and Java compiler, with IntelliJ demo showing x4 and y4 producing 2.
Master the ternary (conditional) operator in Java, handling three operands - boolean expression, true expression, and false expression - using the question mark and colon with practical examples.
Explore Java operator precedence and associativity with examples like 16 - 8 * 2, and learn how parentheses and left-to-right associativity for * / % govern evaluation.
Mastering modern Java programming introduces details of Java operators precedence and associativity, covering dot, method invocation, arithmetic, relational, logical, and lambda operators from highest to lowest priority.
Explore how to control the flow of Java statements using if-else, switch-case, for, while, do-while, break, continue, return, and try-catch-finally.
Explore how Java's if, else if, and else control flow evaluates boolean conditions to run the corresponding code blocks, emphasizing readability and the correct use of curly braces.
Master Java conditionals with if-else and else-if through hands-on demos, including an even-odd check with modulus and a day classifier for weekdays and weekend.
Explore how to use if, else if, and else statements in Java, including the not operator and the and operator, with examples like checking zero and voting eligibility.
Learn to implement nested if, else if, and else statements in Java to drive day-based messages, with real-world debugging in IntelliJ.
Explore how the ternary operator mirrors if-else for single statements. Learn when you can pass a ternary expression as a method argument and why multi-statement blocks require if-else.
Compare if statements and switch case in Java, showing how switch evaluates the expression once, uses break to exit, and supports default labels, compile-time constant case labels, and switch expression.
Explore the switch case statement and the switch expression in Java by building a SwitchCaseDemo, demonstrating break, default, and the required compile-time constants for string inputs.
Explore the switch expression introduced in Java 14, using arrow syntax, comma-separated labels, and a mandatory default to return values.
Master switch expressions in Java 14 with arrow syntax, demonstrate returning values using yield, and compare with switch statements through a compact, practical fruit example.
Explore funny memes about if, else if, else and switch statements in Java, clarifying when to use each conditional and offering interview tips on pseudo code versus syntax.
Learn how the while statement in Java uses a boolean condition to loop, executing code while true and stopping when false, with examples printing 1 to 10 and infinite loops.
Explore how to implement the while statement in Java, print a sequence from 1 to 10, and manage infinite loops with proper i increments.
Explore the do while statement in Java, compare it to while, and learn that do while executes at least once and uses the syntax do { } while (condition).
Explore the for loop theory in Java, detailing initialization, condition, and update expressions, comparing with while loops, and illustrating traditional and enhanced for loop usage with practical examples.
Build a for loop in Java to print the five table from 1 to 10, using initialization, condition, and update expressions, and explore optimization and infinite loop variations.
Explore nested for loops in Java by printing multiplication tables from 1 to 10 and building a five-row asterisk pyramid, using outer and inner loops with i and j.
Master the break statement in Java by using unlabeled and labeled forms to prematurely exit loops or switch cases, with for, while, and do-while examples.
Demonstrates the break statement in Java using a for loop from 0 to 9, exits at i == 5, then shows unlabeled and labeled breaks in an array search.
Learn how the continue statement works in Java loops, including unlabeled and labeled forms, to skip the current iteration and contrast with break in for and while loops.
Discover how the return statement controls method outputs in Java, with if-else and loop examples, and learn to manage multiple returns without missing return errors.
Explore local variables and their scope inside methods and blocks, learn access rules in if, for, do-while, and switch, and apply best practices for naming, initialization, and proximity to use.
Explore local variables and scope in Java through a LocalVariablesDemo showing for loops, if blocks, and switch cases, clarifying how x and i are accessible only inside blocks or methods.
Explore how to structure Java code with packages to organize thousands of classes, prevent naming conflicts, and leverage optional modules introduced in Java 9 for better organization.
Learn how Java packages organize classes, interfaces, and enums into namespaces to manage large code bases, enable encapsulation, control access, and avoid naming conflicts.
Create a Java package within your project and attach a class using the package keyword, while following domain-based and architectural layer naming practices.
Create a production-grade package structure in section9 by adding com.eazybytes.model and related packages like com.eazybytes.service and com.eazybytes.utility to host pojo classes and utilities for UI to backend data transfer.
Learn how to name Java packages by reversing domain names in lowercase, replace invalid characters with underscores, and apply naming guidelines to avoid cross organization conflicts and duplicate class names.
Learn how to access classes across packages with import statements, optionally import entire packages using a wildcard, and use IntelliJ auto import and code completion to optimize and manage imports.
Explore how the java.lang package provides core classes like String and wrapper types without imports, while classes outside java.lang such as Arrays require explicit imports, as IntelliJ auto-import demonstrates.
Master static import statements in Java by using static fields like TAX_RATE and SHIPPING_COST and static methods such as calculateTotalCost, with examples from Math.pi.
Explore how Java handles import statements, avoid recursive imports and nested packages, import subpackages explicitly to resolve class name conflicts with fully qualified names, and avoid overusing import static statements.
Learn how Java access modifiers control visibility of classes, methods, and fields with public, private, protected, and default scopes. Understand how packages and inheritance shape who can access what.
Explore how public, default, private, and protected access modifiers control outer and inner class visibility in Java, including static inner classes, package access, and compilation behavior.
Explore how private, protected, public, and default access modifiers control Java fields and methods, showing access within the same package, from other packages, and via inheritance.
Explore how Java access modifiers, including public, private, default, and protected, govern visibility through real-life toilet analogies. Start with private, then upgrade to default, protected, and finally public.
Explore plain old java objects (pojo) as simple data carrier classes that transfer data between the user interface and backend, shown with a Person model containing firstName, lastName, age, salary.
Learn how to design a pojo class with private fields and public getters and setters to enforce data validation, encapsulation, and access control, while understanding dto and java bean terminology.
Master the four pillars of Java's object-oriented programming, encapsulation, inheritance, polymorphism, and abstraction, by reviewing class and object concepts and encapsulation overview with access modifiers, preparing for interface concepts next.
Learn how inheritance in Java reduces code duplication by centralizing common logic in a superclass for use by subclasses, and understand terms like superclass and subclass.
Explore inheritance by modeling superheroes with a Person superclass and IronMan, SpiderMan, and CaptainAmerica subclasses, sharing common attributes and behaviors while overriding the usePower behavior.
Explore inheritance in Java by building a Person superclass with protected fields and public methods, then extend it with IronMan, SpideMan, and CaptainAmerica to reuse behavior and observe access rules.
Explore how inheritance from the Person superclass enables code reuse, with overridden methods, inherited fields, and single inheritance in Java, plus how to validate via IDE shortcuts.
Explore how the java.lang.Object class is the default superclass for all Java classes, enabling implicit inheritance of methods like hashCode and toString and shaping the object hierarchy.
Explore is-a inheritance and has-a composition in Java, illustrating proper class relationships with inheritance, aggregation, and composition concepts through real-world examples like vehicles and engines.
Discover how a subclass inherits non-private members from its superclass, including public, default, and protected fields and methods, plus static members, while private data and constructors are not inherited.
Learn how upcasting converts a subclass to a superclass in Java, leveraging widening casting and enabling reusable client code; compare this with downcasting to a subclass which requires explicit casting.
Explore upcasting in Java by using an Animal superclass with Dog and Cat subclasses, and see how the printName method works for all objects via a single superclass reference.
Demonstrates upcasting and polymorphism by showing how an Animal reference calls overridden eat methods. The demo shows Cat and Dog behavior under upcasting and mentions downcasting.
Understand downcasting in java, the opposite of upcasting, with a demo using Animal and Dog. See how (Dog) enables downcasting, avoid compilation errors, and guard against runtime ClassCastException.
Use the instanceof operator to guard downcasting and prevent runtime ClassCastException by checking an object's type before casting to Dog or Cat.
Compare the old and new instanceof syntaxes in Java 16, use an object reference name after the class name to enable automatic downcasting, and learn the inheritance rule for checks.
Explore binding in Java, distinguishing static binding at compile time from dynamic binding at runtime, and see how upcasting and downcasting affect which method or field is invoked.
Explore polymorphism in Java, learning how static (compile-time) and dynamic (runtime) polymorphism arise from inheritance, through method overloading and method overriding, with practical animal examples.
Learn how method overriding in Java inheritance lets a subclass replace a superclass non-static method with its own implementation, using the same name, return type, and parameters, aided by @Override.
Explore method overriding in Java through a hands-on demo where IronMan overrides walk from Person and prints a tailored message. Learn the six rules, @Override usage, and access constraints.
Demonstrate dynamic polymorphism in Java with upcasting and method overriding, using a Person–IronMan walk() example to show runtime behavior through dynamic binding.
Master how to use the super keyword to invoke a superclass eat() method from a subclass like IronMan, with @Override and examples using pasta and ice cream.
Explore method overloading in Java, achieving static polymorphism through multiple methods with the same name but different parameter lists, enabling compile-time binding, with or without inheritance.
Explore static polymorphism through method overloading in java by implementing multiple eat() methods with different parameters, access modifiers, and return types, and learn the rules for identifying overloaded methods.
Compare method overriding and overloading in Java, highlighting inheritance, return types, and exceptions. See how compile-time binding differs from runtime binding with practical class examples.
Delve into method hiding in java inheritance, see how static methods are inherited, and observe how upcasting, downcasting, and class-name invocation affect which start() executes.
Learn field hiding in Java inheritance. See how object reference type determines access for same field names in superclass and subclass, and use super to access superclass fields.
Explore how constructors and inheritance interact in Java, including default constructors, super() invocation, and how parameterized constructors require explicit super calls to initialize the superclass.
Explore how constructors and inheritance work in Java, using the super keyword to call parameterized superclass constructors when no default constructor exists, as Car passes water to Vehicle.
Learn how to use the this and super keywords in Java to access current object members, call superclass methods, and invoke constructors within inheritance, in non-static contexts.
Explain the five inheritance types, how Java supports single, multilevel, hierarchical, and hybrid inheritance, why multiple inheritance is not allowed due to the diamond problem, and interfaces offer a workaround.
Explore abstraction in Java by learning abstract classes and abstract methods, how they rely on inheritance, and how concrete versus abstract methods shape subclass behavior.
Use abstract classes to define common behavior with concrete and abstract methods like teach, guiding Mathematics. Understand instantiation limits and inheritance rules to achieve 0 to 100% abstraction.
Learn how the final keyword in Java prevents inheritance, protects variables, methods, and parameters from reassignment or overriding, with practical examples and revision slides.
Java 17 introduces sealed classes and interfaces to control inheritance with permits, enabling only specified subclasses to extend a superclass and ensuring secure, flexible hierarchies.
Explore inheritance in programming through humorous memes, clarify the is-a relationship, and understand the extends keyword in Java with real-world examples.
Welcome to the course Mastering Modern Java Programming: Beginner to Pro, a comprehensive course designed to equip developers of all levels with the essential skills and knowledge to master Java programming from its fundamentals to advanced topics up to Java 25. Whether you're a beginner looking to kickstart your programming journey or an experienced developer seeking to enhance your Java expertise, this course has something valuable to offer.
Course Overview:
This course is meticulously crafted to cover every aspect of Java programming in-depth, ensuring a solid understanding of both the foundational concepts and the latest advancements in the language. Here's what you can expect to learn throughout the course:
Section 1: Let's Say Hello to Java
What is Java & why should you learn
Approach to learn Java language
Writing your first Java statement using jshell
Brief history of Java & it's release timeline
Why do we have different JDK vendors in Java ecosystem
Installation of Java
Section 2: Primitive data types in Java
Introduction to Java Keywords
Deep dive on byte, short, int, long, float, double data types
Syntax to declare primitive data types & store data using them
How to name a java variable
Case Styles in programming
Deep dive on boolean primitive data type
Deep dive on char primitive data type
Demo of Overflow and Underflow
[Java 7] Using underscore in numeric literals
Demo of octal number format in Java
Demo of hexa number format in Java
Demo of binary number format in Java
Type casting in Java
Demo of implicit and explicit casting
Introduction to String in Java
Demo of String in Java
Section 3: What happens behind the scenes when a Java program executes
Introduction to life cycle of a Java program
What is JDK, JRE, JVM
How Java became a platform independent language
Introduction to Java program code structure
Writing first Java class, compiling & running it
Introduction to IDE & IntelliJ IDEA
Create first Java project in IntelliJ & set up a theme
Writing first Java class in IntelliJ
Section 4: Deep dive on Java classes, methods, fields, constructors
Java supports Object-oriented programming (OOP)
Demo of creating a Java class
Declaring fields in a Java class
Demo of Java methods
Introduction to method signature
Purpose of a return statement in Java methods
Syntax of method invocation in Java
Let’s say hi to main method again
How to create & initialize Java objects
Introduction to Constructor in Java
Demo of Constructor in Java & introduction to debugging
Problem with default or no-args constructor
Constructor Overloading in Java
Constructor chaining in Java
Usage of return statement in constructor
Instance Initialization Block in Java class - Part 1
Instance Initialization Block in Java class - Part 2
Introduction to static variables in Java
How to define constant final static variables
Differences between static & instance variables
Introduction to static methods in Java
Static Initialization Block in Java class
Debugging of method invocations in IntelliJ
Where does Java store classes, objects, variables, methods
Deep dive on Heap memory and stack memory
Introduction to null in Java
Object Destruction and Garbage collection in Java
Class vs Object vs Instance vs Reference
What is encapsulation in Java
Section 5: Comments in Java
Single line Comments in Java
Multi line Comments in Java
Introduction to javadoc comments
Generating javadoc using IntelliJ
Section 6: Deep dive on String in Java
Introduction to String Pool in Java
The intern method in String
The concat method in String
Escape sequence character & Unicode char values in String
Finding the length of a String
Comparing Strings in Java
Fetching a character at an index in String
Checking if a String is empty
Changing the case in String
Converting values as String
Searching for a value in String
Trimming a String
Fetching Substring from a String
Replacing a part of a String
Splitting Strings
[JAVA 8] Joining Strings
The format() method in String
System.out.printf() method
Understanding how String objects are immutable
How to create mutable strings in Java
[JAVA 15] Text Block in Java
Converting String to primitive data type values
Convert String to double data type
Section 7: Operators in Java
Introduction to Operators & Operands in Java
Assignment Operator in Java
Introduction to Arithmetic Operators in Java
Addition Operator in Java
String Concatenation Operator
Division Operator in Java
Modulus Operator in Java
Unary plus and minus operators
Compound Arithmetic Assignment Operators in Java
Increment and Decrement operators in Java
Introduction to Relational Operators in Java
Equality Operator in Java
Inequality Operator in Java
Greater than, Greater than or equal, Less than, Less than or equal operators
Introduction to Logical Operators in Java
Logical NOT operator in Java
Logical Short-Circuit AND, Logical AND operators in Java
Logical Short-Circuit OR, Logical OR operators in Java
Logical XOR operator in Java
Compound Logical Assignment Operators in Java
Bitwise Operators in Java
Bitwise NOT operator or 1’s complement in Java
Bitwise AND operator in Java
Bitwise OR operator in Java
Bitwise XOR operator in Java
Left Shift operator in Java
Signed Right Shift operator in Java
Unsigned Right Shift operator in Java
Compound assignment bitwise operators in Java
Ternary or Conditional operator in Java
Details of Java operators Precedence & Associativity
Section 8: Control flow statements in Java
Introduction to Control flow statements in Java
Deep dive on if, else if, else statements in Java
Nested if- else if - else statements
Ternary operator in the place of if-else statement
Deep dive on switch case statement
[JAVA 14] Deep dive on switch expression
Deep dive on while statement
Deep dive on do while statement
Deep dive on for loop
Deep dive on nested for loops
break statement
continue statement
return statement
Local variables & Scope
Section 9: packages in Java
Introduction to packages & benefits of them
Creating a package
Rules & standards to name a package
Using package members with import statement
The great java.lang package
The static import statements
Important points about packages & imports
Introduction to access modifiers
Demo of access modifiers for java classes
Demo of access modifiers for methods, fields in classes
Deep dive on POJO classes
Section 10: Inheritance in Java
Introduction to Inheritance in Java
Object class is the default Superclass
is-a & has-a relationships in Java
What a subclass inherits from its superclass
Introduction to upcasting in Java
Introduction to downcasting & it's demo
instanceof Operator
Static Binding and Dynamic Binding in Java
What is Polymorphism in Java
Method Overriding
super keyword to invoke super class methods from sub class
Method Overloading
Method overriding vs Method overloading
Method hiding in Java Inheritance
Field hiding in Java Inheritance
The story of constructors & Inheritance together
this and super keywords in Java
Types of Inheritance in Java
abstract methods and classes
final keyword in Java
[JAVA 17] sealed classes & interfaces
Section 11: Interfaces in Java
Introduction to Interfaces
Constant Field Declarations in interface
[JAVA 8] How to build default methods in interfaces
[JAVA 8] How to build static methods in interfaces
Multiple Inheritance using interfaces
Interface defines a new type
Marker Interface
[JAVA 8] Functional Interface
Class Vs Abstract Class Vs Interface
Section 12: Arrays in Java
What is a Array in Java
Declaring & initializing Arrays
Arrays length
Iterate elements of Array using for loop
Iterate elements of Array using for-each loop
Arrays advantages and disadvantages
Copying Arrays using loops
Copying Arrays using arraycopy and copyOf methods
Converting Arrays
Sorting Arrays
Searching an Array
Filling an Array
Introduction to multidimensional or nested arrays
Two-Dimensional or 2D Arrays
Jagged Arrays
Three-Dimensional or 3D Arrays
Section 13: Accept input using BufferedReader and Scanner
Understanding System.out.println
Introduction to BufferedReader & Demo
Introduction to Scanner & Demo
Comparison of BufferedReader and Scanner
Don’t use System.out.println in Production code
Logging in Java
Section 14: Exception handling using try, catch and finally
Taste of first Exception
try-catch block
multiple catch blocks
finally block
[JAVA 7] try- with-resources statement
Rules while handling exceptions
The Exception Hierarchy
Checked Exceptions
Unchecked Exceptions
throws keyword
throw keyword
Differences between throw and throws keyword
Exception Propagation
Nested try block
Custom Checked Exception
Custom Unchecked Exception
final, finally and finalize
Section 15: Unmasking Java's Superclass(java.lang.Object) Secrets
Introduction to the methods in Object class
Deep dive on getClass() in Object class
Deep dive on hashCode() in Object class
Deep dive on equals() in Object class
Override hashCode() & equals() methods
Override hashCode() & equals() methods using IntelliJ
Deep dive on toString() in Object class
Demo of hashCode(), equals() & toString() methods of String
Deep dive on finalize() in Object class
Deep dive on clone() in Object class
Details about Shallow cloning & Deep cloning
Mutable and Immutable objects
[JAVA 16] Record classes
[JAVA 10] var (local variable type inference)
Section 16: Introduction to Collections & Wrapper Classes
Arrays have limitations
What are Collections & why they accept only objects
Introduction to Wrapper Classes
Convert Primitive Type to Wrapper Objects (Boxing)
Convert Wrapper Objects into Primitive Types (Unboxing)
Autoboxing and unboxing
Caching with valueOf() methods
Java Collection Framework Hierarchy
Section 17: Lists and ArrayLists Unleashed – A Hilarious Journey through Data Structures
Deep dive on the Collection Interface
[JAVA 21] Deep dive on the Sequenced Collections
Deep dive on the List Interface
How to create objects of ArrayList
Demo of ArrayList
[JAVA 7] Diamond Operator in Java
ArrayList performance
[JAVA 9] Creating Immutable Lists
Iterate ArrayList using for-each and iterator()
Iterate ArrayList using listIterator()
Sorting ArrayList using sort() methods
Sorting ArrayList using custom Comparator
Sorting ArrayList of custom data type using Comparable
Sorting ArrayList of custom data type using Comparator
Arrays vs ArrayList
Section 18: LinkedLists - Java's Dance of Nodes
Introduction of LinkedList
How to create objects of LinkedList
Demo of LinkedList
Iterate LinkedList elements
Sorting LinkedList elements
LinkedList performance
ArrayList vs LinkedList
Section 19: Generics in Java
Introduction to Generics in Java
Why we need Generics in Java
Generic class in Java
Generics methods in Java
Collections with out Generics
Covariance Demo
Subtype or Upper Bound Wildcards
Supertype or Lower Bound Wildcards
Unbounded Wildcards
Section 20: Deep dive on Map, HashMap, TreeMap, LinkedHashMap
Introduction to Map in Java
Demo of HashMap
How HashMap Store Key, Value
How HashMap retrieve Value
[JAVA 8] HashMap improvements in Java 8
Iterating HashMap using keySet() and entrySet()
Iterating HashMap using values()
Introduction to TreeMap in Java
Demo of TreeMap in Java
Demo of LinkedHashMap in Java
[JAVA 9] Creating Immutable Maps
Section 21: Set, HashSet, TreeSet, LinkedHashSet
Introduction to Set in Java
Demo of HashSet
How HashSet works internally
Iterating HashSet
Set operations
Demo of TreeSet in Java
Demo of LinkedHashSet in Java
[JAVA 9] Creating Immutable Sets
List vs Set
Section 22: Enums in Java
Introduction to Enums
Problems with normal Java class constants approach
Demo of Enum approach
Associating Data to Enum Constants
Demo of EnumSet and it's important methods
Advantages of Enums
Section 23: Date and Time in Java
How Java supports Date and Time
Why a new Date API introduced in Java 8
Demo of java util Date
Date formatting and parsing using SimpleDateFormat
Demo of java sql Date
Demo of java util Calendar
TimeZone specific Date and Time
[JAVA 8] Introduction to new Date & Time API from Java 8
[JAVA 8] The of() methods in java.time Date and Time API
[JAVA 8] The from() & withXxx() methods in java.time Date and Time API
[JAVA 8] The toXxx() & atXxx() methods in java.time Date and Time API
[JAVA 8} The getXxx(), plusXxx() and minusXxx() methods in new Date & Time API
[JAVA 8] Introduction to Instant and Duration in java.time Date and Time API
[JAVA 8] Demo of Instant and Duration in java.time Date and Time API
[JAVA 8] Period in java.time Date and Time API
[JAVA 8] The multipliedBy(), dividedBy() & negated() methods
[JAVA 8] The truncatedTo() method
[JAVA 8] Demo of ZoneId, ZonedDateTime
[JAVA 8] Demo of ZoneOffset
[JAVA 8] Demo of OffsetDateTime and OffsetTime
[JAVA 8] Demo of Day Light Saving with ZonedDateTime
[JAVA 8] Non-ISO Calendars in java.time Date and Time API
[JAVA 8] Formatting Dates and Times using DateTimeFormatter
[JAVA 8] Parsing Dates and Times using DateTimeFormatter
Section 24: [JAVA 8] Functional Programming using lambda expressions
Introduction to Functional Programming
Imperative style vs functional style programming
What are lambda expressions and their syntax
How to build Lambda expressions
Deep dive on Functional Interfaces
How Functional Interface & Lambda expressions are linked
Anonymous inner class in the place of lambda expressions
Predefined Functional interfaces inside JDK
Deep dive on Predicate functional interface
Deep dive on Function functional interface
Deep dive on UnaryOperator interface
Deep dive on Consumer interface
Deep dive on Supplier interface
Deep dive on BiFunctional Interfaces
Primitive Type functional interfaces
Deep dive on Lexical Scoping of Lambda expressions
this and super inside lambda expression
Section 25: [JAVA 8] Building Lambda expressions using Method References
Introduction to Method References
Demo of Static Method Reference
Demo of Instance Method Reference
Demo of Instance method Reference using Class type
Demo of Constructor Reference
Section 26: [JAVA 8] Streams API
Introduction to java util stream API
Creating a Stream from collections
Streams have no storage
Introduction to Streams Pipeline
Demo of Streams map() method
Demo of Streams flatMap() method
Demo of Streams filter() method
Demo of Streams limit() method
Demo of Streams skip() method
Streams are traversable only once
Introduction to Streams reduce() method
Demo of Streams reduce() method
Demo of Streams collect() method
Demo of Streams collectingAndThen() method
Demo of Streams groupingBy() and partitioningBy() method
Finding and Matching methods in Streams
Quick revision about stream pipeline
Deep dive on parallel streams and demo
Collections Vs Streams
Section 27: [JAVA 8] Optional to deal with nulls in Java
Introduction to Optional class
Demo of Optional
Demo of ifPresent, ifPresentOrElse, orElse, orElseGet methods
Demo of orElseThrow, map, filter methods
Quick tip to filter null elements with Stream API
Section 28: MultiThreading in Java
What is MultiThreading
How a program or a software executes inside a computer
Parallel vs Concurrent Execution
How multiple threads improve performance
Creating Threads in Java
MultiThreading Demo Program
Demo of Thread methods getId, threadId, getName, setName, currentThread, sleep
Demo of Thread method join, getPriority, setPriority
Demo of wait(), notify(), notifyAll()
Introduction to Race condition & synchronized keyword
Demo of synchronized methods and blocks
Introduction & Demo of volatile keyword
Introduction to Deadlock
Demo Deadlock & possible fixes
[JAVA 21] Introduction to Virtual Threads
Section 29 - New features from Java 22, Java 23 and Java 24
Launch Multi-File Source-Code Programs
Unnamed Variables & Patterns
Markdown Documentation Comments
Stream Gatherers API
Section 30 - New features from Java 25
Module Import Declarations
Compact Source Files and Instance Main Methods
Flexible Constructor Bodies
Scoped Values
Performance improvements using AOT
Throughout the course, you'll engage in hands-on coding exercises, assignments, and projects to reinforce your learning and apply the concepts in real-world scenarios. Our experienced instructors will provide guidance, support, and insights to help you navigate the intricacies of Java programming effectively.
Whether you aspire to become a Java developer, enhance your career prospects, or simply gain a deeper understanding of one of the most widely-used programming languages, this course will empower you to achieve your goals in the world of Java programming.
Prerequisites:
- No prior programming experience required, but familiarity with basic programming concepts will be beneficial.
- A computer with internet access and a willingness to learn and practice.
Target Audience:
- Beginners aspiring to learn Java programming.
- Experienced developers looking to expand their Java skills.
- Students and professionals seeking to advance their careers in software development.
Enroll now and embark on a journey to master Java programming comprehensively, from the basics to Java 24 and beyond!