Java Full Course for free ☕

Share

Summary

This comprehensive Java course covers everything from basic syntax to advanced object-oriented programming concepts. It includes hands-on projects, such as building an alarm clock, to help learners master Java programming.

Highlights

Introduction to Java and Setup
00:00:00

This section introduces Java programming, focusing on setting up the development environment. It covers downloading and installing the Java Development Kit (JDK) and an Integrated Development Environment (IDE) like IntelliJ. The importance of the 'main' method for running Java programs is explained, along with basic output using 'System.out.println' and adding comments.

Variables in Java
00:11:01

This part delves into variables, explaining them as reusable containers for values. It differentiates between primitive data types (int, double, char, boolean) and reference data types (strings). The concepts of variable declaration and assignment are covered, along with camelCase naming conventions and basic string concatenation.

Accepting User Input
00:31:32

This section teaches how to accept user input in Java using the `Scanner` class. It demonstrates reading different data types like strings, integers, doubles, and booleans, and addresses common issues like clearing the input buffer after reading numerical input.

Arithmetic Operators
00:54:15

This segment introduces arithmetic operators in Java, including addition, subtraction, multiplication, division, and the modulus operator. It also explains augmented assignment operators and increment/decrement operators. The order of operations (PEMDAS) is covered to ensure correct calculation logic.

Shopping Cart Program Project
01:02:33

A hands-on project to create a shopping cart program is presented. This project reinforces the concepts of variable declaration, user input, and arithmetic operations to calculate a total price based on item price and quantity.

If Statements
01:09:01

This part explains `if` statements, which execute a block of code if a condition is true. It covers `if`, `else if`, and `else` clauses, demonstrating how to handle multiple conditions. The use of comparison operators for primitive types and the `equals` method for strings is highlighted, along with an example of an age verification program.

Random Numbers
01:22:30

This section covers generating random numbers using the `Random` class. It shows how to generate random integers within a specific range, random doubles, and random booleans, and provides an example of a coin flip simulation.

Math Class
01:27:32

This segment explores useful math-related constants (like Math.PI and Math.E) and methods (like Math.pow, Math.abs, Math.sqrt, Math.round, Math.ceil, Math.floor, Math.max, Math.min). It includes exercises for calculating the hypotenuse of a right triangle and properties of a circle/sphere.

Printf Statement
01:42:01

The `printf` statement for formatted output is explained. It covers various format specifiers for different data types (strings, characters, integers, doubles, booleans), precision for floating-point numbers, and flags for alignment and grouping separators.

Compound Interest Calculator Project
01:56:17

A project to build a compound interest calculator is introduced. This exercise demonstrates accepting user input, performing calculations, and using `printf` for formatted output of financial results.

Nested If Statements
02:03:52

This section explains nested `if` statements, where one `if` statement is placed inside another. An example of a movie ticket discount system is used to illustrate how multiple conditions can be checked hierarchically.

String Methods
02:10:22

This part covers useful `String` methods such as `length()`, `charAt()`, `indexOf()`, `lastIndexOf()`, `toUpperCase()`, `toLowerCase()`, `trim()`, `replace()`, `isEmpty()`, `contains()`, and `equals()`. These methods are crucial for manipulating and validating string data.

Substring Method
02:18:58

The `substring()` method is detailed, showing how to extract a portion of a string based on given indices. An email slicer program is used as an example to demonstrate practical application and make the code more flexible by dynamically finding indices.

Weight Conversion Program Project
02:27:01

A project to create a weight conversion program (pounds to kilograms and vice versa) is presented. This reinforces the use of `if` statements, user input, and basic arithmetic for practical applications.

Ternary Operator
02:35:05

The ternary operator (condition ? valueIfTrue : valueIfFalse) is introduced as a shorthand for simple `if-else` statements. Examples include determining pass/fail, even/odd numbers, time of day (AM/PM), and calculating tax rates.

Temperature Conversion Program Project
02:41:23

This project involves building a temperature conversion program (Celsius to Fahrenheit and vice versa) utilizing the ternary operator. It covers user input, conditional logic, and simple mathematical formulas.

Enhanced Switches
02:49:09

Enhanced switches (Java 14 feature) are explained as a more concise alternative to multiple `else if` statements. It demonstrates how to handle multiple cases, use arrow operators, and implement a `default` case, using a day-of-the-week example.

Simple Calculator Program Project
02:57:46

A project to create a simple calculator program is introduced, applying the concepts of enhanced switches. It handles various arithmetic operations (+, -, *, /, ^) and includes error handling for division by zero and invalid operators.

Logical Operators
03:10:05

Logical operators (`&&` for AND, `||` for OR, `!` for NOT) are covered, enabling the checking and modification of multiple conditions. Examples include temperature ranges and validating usernames according to specific rules.

While Loops
03:21:26

`While` loops and `do-while` loops are explained, demonstrating how to repeat code as long as a condition remains true. It covers preventing infinite loops, using a loop for user input validation, and the key difference between `while` and `do-while`.

Number Guessing Game Project
03:33:51

A project to create a number guessing game is presented. This project integrates random number generation, user input, `do-while` loops, and conditional statements to provide clues (too high/too low) and track attempts.

For Loops
03:43:34

`For` loops are introduced as a way to execute code a specific number of times. It covers initialization, condition, and update statements. Examples include counting up, counting down, and incrementing by more than one. A mini-project demonstrates a countdown timer with a delay.

Break and Continue Keywords
03:53:35

The `break` keyword (to exit a loop) and `continue` keyword (to skip the current iteration) are explained. Simple `for` loop examples illustrate the functionality of each keyword.

Nested Loops
03:55:49

Nested loops (a loop inside another loop) are introduced, often used for working with matrices or grids of data. A project to create a custom symbol matrix with user-defined rows, columns, and symbols is demonstrated.

Methods
04:04:31

Methods are explained as blocks of reusable code. It covers defining methods, calling them, passing arguments, and returning values. Examples include `happyBirthday()` to sing a song, `square()` to calculate the square of a number, and `ageCheck()` for age verification.

Overloaded Methods
04:19:55

Overloaded methods, which share the same name but have different parameter lists, are detailed. This allows for increased flexibility and reusability, demonstrated with an `add()` method and a `bakePizza()` method with varying ingredients.

Variable Scope
04:26:06

Variable scope, defining where a variable can be accessed, is covered. It differentiates between local scope (within a method or code block) and class scope (accessible throughout the class), illustrating how variables with the same name can exist in different scopes.

Simple Banking Program Project
04:31:02

A project to create a simple banking program is introduced. This integrates multiple concepts, including displaying a menu, processing user choices (show balance, deposit, withdraw, exit), using methods for each operation, and handling user input validated by conditional statements.

Dice Rolling Program Project
05:12:44

A project to build a dice rolling program is presented. This involves accepting the number of dice from the user, generating random rolls, calculating the total, and displaying ASCII art representations of each die face. Error handling for invalid input is also included.

Arrays
05:03:00

Arrays are introduced as collections of values of the same data type. It covers declaring and initializing arrays, accessing and modifying elements by index, using `length` property, iterating with `for` loops and enhanced `for` loops, and sorting/filling arrays using the `Arrays` class.

Entering User Input into Arrays
05:12:44

This section demonstrates how to dynamically enter user input into arrays. It covers creating an empty array with a predetermined size and then populating it with user-provided values. An exercise allows the user to specify the number of food items they want to enter into an array.

Searching Through Arrays
05:20:41

This part explains how to search for elements within an array using a linear search approach. It covers iterating through the array, comparing elements, and using a `break` statement when a match is found. It also addresses how to handle cases where the target element is not found and the specific method for comparing strings (`equals()`).

Variable Arguments (Varargs)
05:28:11

Variable arguments, or varargs, are introduced as a mechanism to allow a method to accept a varying number of arguments. This makes methods more flexible and eliminates the need for multiple overloaded methods, demonstrated with `add()` and `average()` methods.

2D Arrays (Multi-dimensional Arrays)
05:34:38

Two-dimensional arrays, where each element is itself an array, are explained for storing matrices of data. It covers declaring and initializing 2D arrays, accessing elements using two indices, and iterating through them using nested loops. A mini-project creates a telephone number pad matrix.

Interactive Quiz Game Project
05:44:15

A project to create an interactive quiz game is presented. This involves using arrays for questions and a 2D array for answer options. The game loops through questions, gets user guesses, checks correctness, and displays a final score.

Rock Paper Scissors Game Project
05:59:17

A project to build a Rock Paper Scissors game is introduced. This involves getting user choices, generating a random computer choice, checking win conditions, and providing an option to play again using a `do-while` loop.

Slot Machine Program Project
06:15:06

A project to create a slot machine program is presented. This involves handling user bets, generating random symbols (emojis), checking for winning combinations, calculating payouts, and managing the player's balance. It integrates `while` loops, conditional statements, and custom methods.

Objects
06:41:49

The concept of objects in object-oriented programming is explained. Objects represent real-world entities with attributes (data they hold) and methods (actions they perform). The video demonstrates creating a `Car` class as a blueprint and then creating `Car` objects, accessing their attributes, and calling their methods.

Constructors
06:51:41

Constructors are introduced as special methods within a class used to initialize objects with unique values. It explains how to define a constructor with parameters and how the `this` keyword refers to the object being constructed, using a `Student` class example.

Overloaded Constructors
07:01:47

Overloaded constructors allow a class to have multiple constructors with different parameter lists, enabling objects to be initialized in various ways. This is useful when some object attributes are optional during creation, demonstrated with a `User` class.

Array of Objects
07:08:23

This section teaches how to create and manage an array of objects. It covers declaring an array of custom class objects, populating it with existing objects or anonymous objects, and iterating through the array to call methods on each object.

Static Keyword
07:12:12

The `static` keyword is explained for modifying variables or methods so that they belong to the class rather than individual objects. It's used for shared resources or utility methods, demonstrated with a `Friend` class to track the total number of friends created.

Inheritance
07:22:06

Inheritance, where one class inherits attributes and methods from another class, is detailed. It covers using the `extends` keyword to establish a parent-child relationship (e.g., `Dog` and `Cat` extending `Animal`), allowing for code reusability and specialized behavior in child classes. Multi-level inheritance is also briefly shown.

Super Keyword
07:31:12

The `super` keyword, used to refer to the parent (superclass) in inheritance, is explained. Its primary use in calling a parent's constructor from a child's constructor to initialize inherited attributes is demonstrated with `Student` and `Employee` classes inheriting from `Person`.

Method Overriding
07:41:40

Method overriding is explained as a subclass providing its own implementation of a method inherited from a parent class. This allows for specific behavior in child classes while maintaining code reusability, illustrated with an `Animal` class and its `Dog`, `Cat`, and `Fish` subclasses, where `Fish` overrides the `move()` method.

ToString Method
07:46:09

The `toString()` method, inherited from the `Object` class, is discussed. It explains how to override this method to provide a meaningful string representation of an object's details instead of its default hash code, using a `Car` class as an example.

Abstraction
07:52:03

Abstraction is introduced as the process of hiding implementation details and showing only essential features. It covers abstract classes (`abstract` keyword) that cannot be instantiated directly and can contain both abstract methods (must be implemented by children) and concrete methods (inherited by children). A `Shape` class example demonstrates this concept.

Interfaces
08:01:35

Interfaces, similar to abstract classes but with key differences, are explained. They act as blueprints for classes, specifying abstract methods that implementing classes must define. Interfaces also allow for multiple inheritance-like behavior, demonstrated with `Prey` and `Predator` interfaces implemented by `Rabbit`, `Hawk`, and `Fish` classes.

Polymorphism
08:07:49

Polymorphism (meaning 'many shapes') is introduced as a general programming concept where objects can identify as other objects (e.g., a `Car` is a `Vehicle`). It shows how objects of different types can be treated as objects of a common superclass or interface, making code more flexible, illustrated with different `Vehicle` types in an array.

Runtime Polymorphism (Dynamic Polymorphism)
08:14:29

Runtime polymorphism is explained, focusing on how the method executed is decided at runtime based on the object's actual type. An example demonstrates a user choosing an animal (dog or cat) during program execution, and the corresponding `speak()` method is called dynamically.

Getter and Setter Methods
08:19:36

Getter (read) and Setter (write) methods are explained as tools to protect object data and add rules for accessing or modifying attributes (encapsulation). It demonstrates making attributes `private` and then providing public getter and setter methods, with an example of validating price input in a `Car` class.

Aggregation
08:29:41

Aggregation, representing a 'has-a' relationship between objects, is discussed. One object contains another, but the contained objects can exist independently. An example shows a `Library` object containing `Book` objects, highlighting that `Book` objects can exist without the `Library`.

Composition
08:39:04

Composition, representing a 'part-of' relationship, is explained as a stronger form of aggregation where one object is an integral part of another and cannot exist independently. An example demonstrates a `Car` object composed of an `Engine` object, where the `Engine` is created and destroyed with the `Car`.

Wrapper Classes
08:45:20

Wrapper classes are introduced as a way to treat primitive values (int, double, char, boolean) as objects. It covers autoboxing (primitive to wrapper) and unboxing (wrapper to primitive), and highlights useful static utility methods provided by wrapper classes for type conversion (e.g., `Integer.parseInt()`, `Character.isLetter()`).

ArrayLists
08:55:53

`ArrayLists` are explained as resizable arrays that store objects. It covers declaring and initializing an `ArrayList`, adding, removing, setting, and getting elements, checking its size, sorting, and iterating. An exercise demonstrates populating an `ArrayList` with user input.

Exceptions
09:05:31

Exceptions, events that interrupt the normal flow of a program, are discussed. It covers using `try-catch` blocks to handle exceptions gracefully, specifically `ArithmeticException` and `InputMismatchException`. The `finally` block for resource cleanup (e.g., closing a `Scanner`) and `try-with-resources` for automatic resource management are also explained.

Writing Files
09:15:05

This section demonstrates how to write to a file using `FileWriter`. It covers creating a `FileWriter` object, specifying a file path, writing string content, and robustly handling potential `IOException` and `FileNotFoundException` using `try-with-resources`.

Reading Files
09:21:59

Reading from a file is explained using a combination of `BufferedReader` and `FileReader`. It covers specifying the file path, reading content line by line using a `while` loop, and handling `FileNotFoundException` and `IOException` using `try-with-resources`.

Audio Player Project
09:29:00

A project to create a basic audio player is presented. This covers playing `.wav` files (note: not MP3s directly without external libraries). It involves setting up `AudioInputStream` and `Clip` objects, handling various audio-related exceptions, and creating interactive controls (play, stop, reset, quit) for the user.

Hangman Game Project
09:43:13

A project to build a Hangman game is introduced. This involves selecting a secret word, representing its state with underscores, accepting user guesses, updating the word state, tracking wrong guesses, and displaying ASCII art for the hangman. An advanced version integrates reading words from a file and random word selection.

Dates and Times
10:11:44

This section introduces working with dates and times in Java using `LocalDate`, `LocalTime`, `LocalDateTime`, and `Instant` (for UTC). It covers retrieving current date/time, creating custom `LocalDateTime` objects, formatting them with `DateTimeFormatter`, and comparing dates using `isBefore()`, `isAfter()`, and `equals()`.

Anonymous Classes
10:20:25

Anonymous classes are explained as unnamed classes used for one-time behavior customization without creating a separate class file. This is useful when an object has unique behavior that doesn't warrant a full class, demonstrated by customizing the `speak()` method of a `Dog` object directly.

Timers and Timer Tasks
10:25:27

Timers and TimerTasks are introduced for scheduling tasks at specific times or periodically. `Timer` schedules the task, and `TimerTask` defines the task to be executed. Anonymous classes are used to implement the `run()` method of `TimerTask`, demonstrating how to schedule tasks with delays and fixed rates, and how to cancel a timer.

Countdown Timer Project
10:31:47

A project to create a countdown timer program is presented, leveraging `Timer` and `TimerTask`. It accepts user input for the countdown duration, displays the time in a formatted way using carriage return for in-place updates, and signals completion.

Generics
10:38:21

Generics are explained as a concept for writing classes, interfaces, or methods compatible with different data types. It covers type parameters (placeholders like `T`) and type arguments (actual data types like `String` or `Integer`). Examples include `ArrayList` and custom `Box` and `Product` classes that can hold various types.

HashMaps
10:52:12

HashMaps, a popular data structure, are introduced. They store key-value pairs where keys are unique but values can be duplicated, without maintaining any specific order. It covers creating a `HashMap` with type arguments for keys and values, adding/removing/getting elements, checking for key/value existence, and iterating through keys.

Enums (Enumerations)
11:02:44

Enums (enumerations) are explained as special classes representing a fixed set of constants, improving code readability and maintainability. They are particularly efficient with `switch` statements when comparing strings. An example of a `Day` enum with associated values is used to demonstrate their usage and advantages. Error handling for invalid enum input is also included.

Threading
11:12:47

Threading, allowing a program to run multiple tasks simultaneously, is introduced. It covers creating threads by implementing the `Runnable` interface (preferred over extending `Thread` class) and placing time-consuming code in the `run()` method. An example demonstrates a countdown timer running in a separate thread while the main thread handles user input. The concept of Daemon threads for exiting with the main thread is also explained.

Multi-threading
11:23:05

Multi-threading builds on the previous lesson, demonstrating how to run multiple threads concurrently. It reiterates creating `Runnable` objects (using anonymous classes) and `Thread` objects, then starting them to run in parallel. An example illustrates two threads printing 'ping' and 'pong' simultaneously, and the `join()` method is introduced to make the main thread wait for other threads to complete.

Creating a Working Alarm Clock Project
11:31:12

A final project to create a working alarm clock is presented, integrating many concepts learned throughout the course. This involves accepting user-defined alarm times, formatting time display, using a `while` loop to continuously check the current time against the alarm, and playing an audio file (`.wav`) as the alarm sound. The alarm runs on a separate thread, and `try-catch` blocks handle various potential exceptions.

Recently Summarized Articles

Loading...