
Install java 21 via sdkman on macos and install the IntelliJ IDE community edition via homebrew; switch between java versions and verify installations.
Learn to install the latest Java development kit with OpenJDK 21 and set up IntelliJ IDEA Community on Windows using Chocolatey, PowerShell as administrator, and a correct PATH.
Install Java 17 on Windows using the Windows x64 installer from the Java SE 17 archive. Verify the installation by running java -version in the command prompt.
Install the Java development kit (JDK) version 17 on macOS by downloading the arm64 dmg installer from Oracle and running the installer, then verify with java -version.
Download and install the IntelliJ IDEA community edition, select the right OS build, and ensure compatibility with Java 17 and Gradle.
Ask for help by posting a detailed question in the lesson Q&A, including your operating system, Java version, and the failing code, and share snippets via Git and GitHub gist.
Discover over 100 practice exercises in a downloadable PDF, with a GitHub repository of solutions and margin notes to guide you through class objects, methods, and other Java foundations.
introduces object oriented programming in Java by modeling real world concepts as classes and objects such as person, address, and pet, highlighting inheritance and the to string method.
Explore the basics of class anatomy in Java, including creating classes, package organization, visibility, and access rules, as a news agency interviews a company while restricting factory workers.
Explore the var keyword in Java to infer local variable types when initializing inside methods. Note its limit: only for local variables, not instance fields.
Explore Java methods as blocks of code inside a class that take inputs, may return values, and demonstrate with say hello, say something, and add methods.
Learn how to use varargs in Java to pass a variable number of arguments to a method, comparing to arrays, using ellipses, and accessing elements.
Learn how static methods let Java run code without an instance, and how the main method serves as the program's entry point and a utility class groups static methods.
Examine how static variables differ from instance variables and why static methods access only static members, with pi as an example of a shared constant across all class instances.
Learn how class member visibility controls access to public, private, protected, and package protected members across packages and classes, with practical examples of how packaging and subclassing affect accessibility.
Initialize new objects in the person class using constructors, including a no-arg default and a three-argument version for name and date of birth.
Learn how getters and setters protect private fields, expose controlled access, and optionally transform data, demonstrated by capitalizing names and using setters to enforce formatting.
Exercises & Supplements for "Classes, Objects & Methods" Module.
Please find the link to the coding exercises provided by the web site, w3resource, in the resources section of this lesson. The exercises are meant to be used for this whole module.
Master removing whitespace in Java by using strip and trim to clean leading and trailing spaces, and explore strip leading, strip trailing, and strip indent with text blocks.
Learn how the java compareTo method orders strings, including non-latin text, and how ignore-case comparisons work. See practical examples with apple, banana, and korean text.
Discover how the Java contains method checks if a string includes a given sub string with exact matches, using seven in four score and seven years ago as an example.
Explore string concatenation in Java, using plus signs, string builder, and format methods, and learn when to choose readable, efficient approaches for combining text.
Explore how the length method returns the number of characters in a string, using zero-based indexing to access characters safely and guarding against out-of-bounds errors; learn about string builder efficiency.
Explore how substrings extract parts of a string using the substring method, including start indices and lengths, and learn practical techniques for uppercasing, concatenation, and using string builder.
Learn how the endswith and startswith methods verify file name patterns, such as ensuring a string ends with .txt and begins with file, return booleans, and demonstrate method chaining.
Use contentEquals to compare string contents for equality across strings, string buffers, and string builders. Discover how contentEquals handles character sequences and returns booleans, and how it differs from equals.
Please refer back to the last lecture/article in Section 1, "Coding Exercises for Whole Course"
Explore regular expressions in Java by testing string literals with matches, uncovering case sensitivity and the power of character classes, ranges, and negation in patterns.
Learn to use capture groups in regex to extract phone-number digits, including country code up to two digits, area code, exchange, and line number.
Learn to use named capture groups and non capture groups to simplify regex numbering and reference country code, area code, exchange, and line number by name.
Enable comments in regular expressions to annotate complex patterns, using flags and the pattern class. Use text blocks to improve readability, and break patterns into parts with named capture groups.
Expand phone number parsing to accept optional parentheses and country code in North American formats using escaped parentheses and optional groups.
Learn how regex in Java uses the dot to match any character, anchors like caret and dollar, and classes such as word, digit, and non-space, with boundary and ASCII notes.
Turn scanned transcripts into searchable data with a Java parser. Use OCR, regex, and named capture groups to extract fields such as student number, birth date, grade, gender, and GPA.
Explore how the greedy asterisk in regex can backtrack and grab the remainder of a string, then master non-greedy matching with ? to capture the correct values like 3.82.
Learn to find multiple matches in a multi-line string with Java's regex engine, using Pattern and Matcher, named capture groups, and start/end indexes.
Please refer back to the last lecture/article in Section 1, "Coding Exercises for Whole Course"
Explore how numbers are stored in memory and manipulated in Java, and reveal how data types influence programming decisions.
Explain how computers store data in memory using bits and bytes. Show binary encoding and ASCII values like 65, and how decimal numbers convert to binary via powers of two.
Explore hexadecimal, a base-16 system using 0–9 and A–F, and how it compresses binary and decimal data. See nibble concepts, byte alignment, and memory addresses represented in hex.
Explore how floating point numbers are stored in memory, compare float and double, and learn why binary representation yields approximation that impacts money calculations.
Move beyond Math.random by using java.util.Random, call nextInt with an upper bound, and optionally seed the generator; for stronger needs, try SecureRandom with a byte[] seed.
Translate physics formulas into Java by computing path velocity, centripetal acceleration, and centripetal force through modular, overloaded methods using mass, radius, and period.
compare numbers in Java using equals (==) and not equals (!=), differentiate from the assignment operator (=), and cover greater than or equal to, less than or equal to checks.
Discover how BigDecimal fixes precision issues when using float or double by instantiating with strings for exact values, and use its methods like subtract for precise decimal arithmetic.
Explore key big decimal methods for precise math, including add, subtract, multiply, divide with math context, and handling non-terminating decimals. Learn sqrt, max and min, absolute value, and remainder operations.
Explore how to instantiate big decimal and big integer, including string vs primitive constructors, and learn about precision loss when using doubles, plus conversions to byte, int, and string.
Develop a Java compound interest calculator using BigDecimal to compute future balance from principal, rate, years, and annual contributions, applying the one plus rate to the power of years.
Format money and numbers in Java with NumberFormat, using get currency instance and locale cues to display readable amounts and parse inputs for a usable currency interface.
Explore how to customize Java number formatting using the number format and decimal format classes, including currency and percent instances, locale handling, patterns, and negative values in parentheses.
Learn a printf based approach to formatting numbers, including two-decimal precision, dollar symbol, thousands grouping, and negative parentheses, with String.format as an equivalent tool for money formatting.
Please refer back to the last lecture/article in Section 1, "Coding Exercises for Whole Course"
Learn to control program flow with if/else conditionals in Java, test booleans, compare with equals and not equals, and apply else and else if to respond to random numbers.
Explore inequalities in conditionals with if-else statements, use relational operators, and combine conditions with logical and and logical or, plus modulo, to classify numbers and set colors.
Demonstrates using the switch statement to route on a value with cases and breaks, including default, illustrated with numbers and strings, and contrasts with if-else and null handling.
Showcase switch expressions in java 14, using arrow syntax and yield to return values, including blackjack card value logic, ace handling, and parsing integers from cards.
Learn how to use switch statement pattern matching with Java 17 preview features, enable them, and handle types, including nulls and cases like strings, integers, and person objects.
Refine a guessing game loop by enforcing a not equal to Q condition, validate numeric input with a regex (optional negative), and guard against nulls and parse errors.
Learn how do-while loops differ from while loops, with the do clause guaranteeing at least one execution and how to convert a while loop to a do-while loop in Java.
Explore do/while loop control by adding a max allowed tries to a guessing game, replacing magic numbers with a constant and using wrong guess count to end the program.
Discover how to replace a do while loop with a for loop to limit guesses to four, and understand for loop syntax, scope, and the break and continue commands.
Master the basic for loop by building a simple example that counts from 1 to 10, demonstrates initialization, condition, and increment, and prints each counter value.
Demonstrates using the enhanced for loop to iterate over a fruit array, printing each item with simpler syntax. Explains that a local variable receives each element, avoiding explicit indexing.
Apply loops to regex patterns by using a while loop with match.find to extract multiple matches and print first name, last name, and date of birth from a multiline string.
Please refer back to the last lecture/article in Section 1, "Coding Exercises for Whole Course"
Master automated testing in Java using JUnit, the de facto standard framework, and other open source tools to run scalable tests with add-on libraries.
The Maven coordinates I used in this lecture are:
org.junit.jupiter:junit-jupiter
You can copy this and paste it into the window where you saw me paste it too.
Explore how to write your first unit test in Java using JUnit, create test classes in the test folder, and design a calculator using test driven development.
Explore test-driven development by creating a second unit test for adding numbers, running tests, and refining code to pass while reducing duplication through setup and refactoring.
Explore edge-case testing for the calculator add method by examining max int value plus one, using long for precision, and revealing assumptions and potential bugs around the sign bit.
Learn how to implement and test ordinary annuity calculations in Java 21, using BigDecimal for precise money math, unit testing, and test-driven development with annuity scenarios.
Practice test-driven development by building a Java guessing game, implementing win/lose tests, a get random number method, and evolving test setup and game logic.
Analyze how to test randomness in a Java number-guessing game by using an array tally approach to verify a fair 1–10 number spread.
Enforce four guesses in a number guessing game by counting attempts with a counter, and validate wrong and correct outcomes with tests that format the messages.
Revise tests for exceeding four wrong guesses, replace hard-coded outputs with a single response string, and refactor to mutual exclusion using a counter and string format, highlighting unit testing.
Explore implementing a guessing game feature with too low and too high hints, refactoring for message formatting, and validating with JUnit assertions and test-driven development.
Reimplements the guessing game user interface as a runnable command-line program, wiring a stateful game instance with console input/output and a do-while loop, showing UI separation from game logic.
Learn how to debug Java code with an IDE by setting breakpoints, stepping through lines, inspecting variables, and reloading changed classes during debugging.
Master debugging with breakpoints, conditional stops, and view breakpoints; learn when to step over, avoid third-party code, and reinforce bugs with tests and automated builds.
Please refer back to the last lecture/article in Section 1, "Coding Exercises for Whole Course"
Revisit object-oriented concepts like classes and models to deepen your understanding of Java's power. Explore remaining concepts to unlock foundational skills and elevate your Java development.
Learn how enums in java model finite sets, like card suits and ranks, enabling type safety and cleaner blackjack code.
Learn to attach fields to enums, create a custom constructor, and override toString to render card suit symbols via Unicode, with unit tests verifying behavior.
Windows (and maybe Linux) users may have trouble displaying the card suit characters on the console in this lesson. If so, you may need to do the following:
Go to menu:
Help / Edit Custom VM Options... /
In the editor that opens, add the following two lines to the end:
-Dconsole.encoding=UTF-8
-Dfile.encoding=UTF-8
Then, restart IntelliJ.
Discover how the this keyword refers to the current object to access class fields and methods, and resolve ambiguity with local variables in constructors.
Introduce four role specific classes, programmer, manager, analyst, and CEO, to refactor the salary program from procedural to object oriented, with constructor based parsing and a get salary method.
Refactor by creating a base employee class and pull up common fields, reducing duplication among programmer, manager, analyst, and CEO, while updating constructors and using extends and protected members.
Refactor the employee subclasses into a single super class to remove duplication. Consolidate common fields and formatting logic such as date time format and money format via the super constructor.
Explore strategies for dealing with null cases in Java, including safe default handling in switches, avoiding null pointer exceptions with dummy or real employees, and applying null checks.
learn how abstract classes enforce subclass implementation of methods like get salary, replace duplicated bonus logic in a superclass, and apply the template method pattern in a Java class hierarchy.
Learn how to extract responsibilities from a main class by introducing a factory method on the employee class to instantiate role-based subclasses, simplifying code and improving maintainability.
Learn to implement a private static final nested class dummy employee inside a class, extending employee and implementing getSalary. Handle constructors, final fields, and a factory method for instantiation.
Explore nested classes in Java, comparing static nested classes and inner classes, and learn about anonymous and local nested classes, including when to use each for accessing enclosing fields.
Explore how Java records replace boilerplate classes with a concise, immutable data carrier. See how records provide getters, hashCode and equals, prevent setters, and allow interface implementation.
Use instanceof and pattern matching to differentiate programmer and manager outputs while iterating employees, replacing get class checks with type aware printing in Java 16.
Explore the new features of Java 21, including switch pattern matching, records for programmer data, and unnamed patterns to simplify guards on lines of code per day.
Explore core object-oriented concepts in Java, including encapsulation, inheritance, composition, and polymorphism. See how interfaces and abstract classes shape design and how delegation and the template pattern support flexible code.
Please refer back to the last lecture/article in Section 1, "Coding Exercises for Whole Course"
Explore how to model a chessboard in Java, including a chessboard class, chess piece hierarchy, and coordinates, and walk through adding and retrieving pawns using chess notation like A2.
This lecture walks through knight movement tests from exercise 10 onward, detailing northeast moves, valid moves calculation, and how the chessboard moves a knight from c1 to d3.
Explore implementing knight move validation in a Java chess board, including preventing moves to invalid squares, blocking friendly occupancy, and capturing enemy pieces with captured piece tracking.
Discover how Java collections store objects with dynamic size, compare them to arrays, and explore the collections framework’s interface-driven hierarchy from list to map.
Explore lists as dynamic, ordered collections that grow beyond arrays, use generics to store employees safely, and iterate with enhanced for loops to total salaries.
Learn to loop over a collection with an iterator to remove items safely, compare it with the enhanced for loop, and understand hasnext and next.
Learn quick list creation with array list and list.of, and remove items by object or index, while exploring iterator use and basic patterns across lists, sets, and maps.
Explore advanced list methods in Java, including add at a specific index, add all, contains, indexOf and lastIndexOf, remove, subList, retain all, set, toArray conversions, and unmodifiable lists via List.of.
Sort lists with the list sort method and a comparator, using anonymous classes or lambdas, and explore Arrays.sort and Collections.sort. Implement comparable for natural ordering in strings and employees.
Explore the set interface and learn how hash sets prevent duplicates, compare them with lists, and understand hash codes, contains checks, and the performance implications.
Learn how hash sets filter duplicates via hash codes and equals, using an employee's last name, first name, and date of birth, influenced by Effective Java guidance.
Learn how a linked hash set preserves insertion order while filtering duplicates via equals and hashCode, and compare it to hash set's performance and lack of random access.
Explore how the TreeSet filters duplicates and orders items using a comparable implementation or a comparator, illustrating how last name versus first name affects results.
Explore how maps in the Java collections framework store key-value pairs, enabling lookups and data association, with common implementations: hash map, tree map, and linked hash map.
Learn how to implement a get salary method in a Java main class, write JUnit 5 tests, and switch from list traversal to a hash map for fast lookups.
Transform lookups by building a map from first names to salaries, using hash map, tree map, or linked hash map; observe how keys update with duplicates and retrieval is fast.
Explore common map methods in Java, including get, put, values, keySet, entrySet, containsKey, getOrDefault, isEmpty, putIfAbsent, remove, and putAll, with examples showing insertion order and entry iteration.
Discover Java 21 collections changes, including the sequenced collection interface, which enables first and last access, duplicate removal with preserved insertion order, and updated list and linked hash set relationships.
Please refer back to the last lecture/article in Section 1, "Coding Exercises for Whole Course"
Explore the streams api by re-implementing text processing with lines into employee objects using map, forEach, and method references, showcasing lambdas and a pipeline approach.
See how the streams API processes text lines through lines, map, and create employee, then uses for each to print each i employee in a running pipeline.
Explore how to create streams from collections and arrays, use stream, of, range, and boxed methods, map operations, and read lines from files.lines, including null handling and empty streams.
Learn to sum employee salaries with the streams API by mapping text to employee objects and then to salaries. Use mapToInt and sum to compute total, and print the results.
Sort employees with the streams API, using sorted and comparator logic to order by last name, first name, and salary via method references and then comparing.
Learn to filter data with the streams API, remove duplicates using distinct, and shape results with collect, predicates, and parallel streams for performance.
Learn advanced filtering techniques using predicates and lambdas in Java streams to exclude specific records, and apply methods like Predicate.not and negate for flexible criteria.
Learn to flatten a stream of first names into a single stream of unique characters using flatMap in the Java streams api, with split and optional lowercase normalization.
Explore the map reduce pattern to map data into meaningful summaries, such as salaries, counts, averages, and min/max, and learn how optional doubles and parallelization enhance processing.
This lesson has one downloadable resource in it, which is a data file (a CSV files) containing 5,000,000 sample records (may take a while to download, it's 629 MB) for us to practice Streams techniques on. Please download this file to your computer and unzip it to a location to be accessed by your Java code as you follow along with the following lessons.
This file originally came from: https://eforexcel.com/wp/downloads-16-sample-csv-files-data-sets-for-testing/ if you'd like to download it directly from its original source or look at other files there.
Learn to use streams API to sum salaries by mapping arrays to a domain model, then collect results using a record-based person.
Group records by state using the collect method’s grouping by, returning a map of string to list of person, and alphabetize results with a tree map, illustrated with spreadsheet visuals.
Learn to group data by a field and apply summing and formatting with Java collectors, producing a state-to-salary map and neatly formatted key-value results.
Learn to nest grouping by state and gender in Java streams, aggregate salaries, and format results as currency using a tree map.
Explore the functional methods on maps and other collections using streams API, lambda expressions, and method references; learn through examples of for each, replace all, compute, and merge.
Please refer back to the last lecture/article in Section 1, "Coding Exercises for Whole Course"
Note: This course is intended for absolute beginners to programming OR those who don't mind a slower pace to learning Java. If you're looking for a faster-paced course, this may not be for you (though you can play back at 2x speed & may still find great things to learn). Also, even for those who already know some basic Java, you could skip over the parts you already know and focus on those you may not, like Regex, Streams/Lambdas API, Optionals, Date/Time, SQL/Database/JDBC sections that even seasoned Java developers may not know as well as they should. Many of my sections on these APIs are as long or longer than MANY stand-alone courses dedicated to just one of these topics - for similar prices. Check out my preview videos from each of those sections to gauge how deep I go into each topic.
If you're interested in starting a new career as a professional software developer, learn the fundamentals from an instructor who has interviewed, hired, managed & mentored numerous developers over the years. This course will teach you all the REAL Java skills you need to land your first job and excel. It focuses on skills you're actually likely to use most often and tries to de-emphasize more "academic" knowledge. The instructor has taken his experiences and observations of both successful and unsuccessful developer candidates to create a course that tries to ensure success in landing highly-coveted developer roles
In this course, you'll learn such topics as:
Object Oriented Programming (OOP)
Too many so-called "Java" developers have learned the syntax of the language but have no idea how to harness its actual power to write sophisticated software that's easier to maintain and collaborate on.
Regular Expressions
Another unfortunate observation is that a majority of Java developers are very weak with Regular Expressions. This is unfortunate because so much of what Java tends to be used for, involves processing text and checking that it is valid or parsing key information out of it. Without the use of Regular Expressions, these tasks require considerable amounts of error-prone code that is inflexible and difficult to maintain.
Functional Programming with Lambdas & Streams API
Another sore-spot among a large number of Java developers. As of 2023, Java 21 is out, but the Functional programming APIs of Lambdas & Streams were introduced into Java with version 8. We've observed that developers simply aren't keeping up with these powerful (not-so-new anymore) techniques that help keep Java competitive and efficient in an increasingly functional programming world. You can sift through large datasets with ease and significantly less code with these APIs.
Optionals
Tony Hoare, the inventor of the programming concept of "null", called its invention his "billion-dollar mistake" dating back to 1965. That mistake has gone on to wreak havoc across numerous programming language ever since. Optionals seek to remedy that mistake. Unfortunately, not enough Java developers have learned and embraced the power of using Optionals. This topic seeks to remedy that shortcoming
Java 8 Date/Time API
Java was introduced in 1995 and heralded as the great, shiny new programming language of our time. To a large degree, one could argue that it is indeed, that. However, mistakes were made along the way. One of those mistakes was the way dates & times were handled. Java 8 made major strides in fixing those mistakes, but as with Optionals, Lambdas and many other topics mentioned, not enough developers have taken the time to learn the new and greatly improved Java 8 Date/Time API. We'll show you how to keep time the right way.
Working with Databases & SQL
One of the topics where it seems Java developers actually have kept up (mostly) is in learning modern ways to work with databases in Java - primarily through the use of frameworks like Spring Boot. However, one unfortunate side-effect of the massive levels of abstraction these frameworks afford us, is that many developers have little-to-no idea of what these frameworks are doing or how to use them to maximum effect. We'll peel back the covers and give a solid foundation of the basics to better empower developers as they inevitably continue to use frameworks to make this work easier.
An Introduction to The Spring Framework & Spring Boot
The Spring Framework & its sibling, Spring Boot, have absolutely revolutionized modern Java software development - particularly for business. Dare I say virtually no company doing Java these days, even considers doing it without Spring or at least one of its few and much less popular competitors. You WILL have to learn Spring to be a true and well-rounded Java developer competitive in the job market. Though this course if focused on the fundamentals of Java, we knew we had to whet your appetite for the full(er) stack of Java development. Spring is what most companies use to enable their Java applications to become web applications and web services and talk to databases. This module will set you up for Neutrino's upcoming course dedicated to the topic in full (because it deserves its own course).
So, if you're willing to put in the work, come join us and begin the next phase of your career.