Java Programming – the Master Course
4.4 (268 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
3,194 students enrolled

Java Programming – the Master Course

From Java Beginner to Java Expert in ten simple steps
4.4 (268 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
3,194 students enrolled
Created by Huw Collingbourne
Last updated 8/2019
English [Auto]
Current price: $104.99 Original price: $149.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 7.5 hours on-demand video
  • 2 articles
  • 2 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Master Java programming concepts from the ground up
  • Use the source code examples to learn step-by-step
  • Learn the basics - perfect for beginners
  • Understand the special features of Java: object orientation, garbage collection, cross-platform development and serialization
  • Videos explain everything in minute detail
  • Read the supplied eBook, The Little Book Of Java, to explore the topics in even more depth
Course content
Expand all 88 lectures 09:23:10
+ Getting Started
6 lectures 15:15

Welcome to this course on Java programming.

Preview 03:24

First install Java and an IDE (Integrated Development Environment) to help you write programs. This video explains how to do this on a Mac or on Windows.

Install Java and NetBeans

An overview of the Java language.

What is Java?

Download the Source Code Archive from the Download page of the Resources...

Source Code Archive

This is the course text – an eBook of 125 pages, which covers the same topics as the video tutorials. Use this book to revise the lessons and study Java in more depth.

The Little Book Of Java
127 pages

A short overview of the NetBeans IDE. Find out how to create Project groups to load and build the projects from the source code archive.

How to use the demo projects in NetBeans

The Java language and the NetBeans Integrated Development Environment (IDE)

Java and NetBeans
3 questions
+ First Steps in Java
8 lectures 52:44

In this lesson I’ll show you how to create a simple ‘Hello world’ Java program step-by-step using the NetBeans IDE.

Preview 03:42

Let’s take a closer look at my ‘Hello world’ program in order to identify some important features of the Java language.

Making sense of Java code

Sometimes you may want to run your programs from the ‘command prompt’ or Terminal. Here I explain some simple ways of doing that on a Mac and on Windows.

How to open a command prompt in Windows and the Mac

It is sometimes useful to pass arguments to a program when it first starts. Here I show how to do this at the commandline or within NetBeans.

How to pass arguments to a program

Many of the projects in this course will be created as ‘visual’ applications with a windowed user interface. This video explains how to create visual Java programs.

How to create visual applications

How does your Java code get compiled? And what happens when it is run? Here I explain the basics of the Java compiler and the Java Virtual Machine.

Compiling Java programs – from source code to bytecode

When you want to display text at the system prompt, you will need to be familiar with the print, println and printf methods. Here I explain what these are and how to use them.

Printing text at the system prompt

When you want to display text in visual components such as text fields and buttons, you need to use special methods such as setText(), as we’ll discover in this lesson.

Displaying text in visual controls

The basic building-blocks of Java code

Essential features of Java programs
3 questions
+ The Fundamentals of Java Programming
11 lectures 01:03:13

By now you should be familiar with the basics of writing, compiling and running simple Java programs. In this step we’ll be find out more about the building blocks of those programs – and here I want to take a first look at data types and variables.

Preview 06:08

Variables give you a way of storing values that can be changed. But sometimes you want to make sure that certain values cannot be changed. That’s what constants are for.


In this hands-on lesson I show you exactly how I designed and coded my Tax Calculator application. If you are new to NetBeans you might find this step-by-step guide useful.

Design and program a calculator in NetBeans

Packages give you a way of grouping together related classes. Once you create a package you will need to import its contents to other code files. This lesson explains how.

Packages and imports

Often you will need to convert numbers to strings and vice versa. Here I explain the difference between numeric and string data types and show how Java can help convert one to the other.

Type conversion

What’s the difference between and int and an Integer or a double and a Double? In this lesson I explain primitive data types and Java’s corresponding ‘wrapper’ classes.

Primitives and wrappers

Sometimes it may be useful to tell the Java compiler to treat one data type as another data type – you can do that by ‘type casting’.

Type casts

Numbers that you enter in your code are ‘numeric literals’ – here I explain how Java treats these.

Numeric literals

You don’t always have to convert numbers (and other types of data) to strings – sometimes Java does it for you.

Automatic string conversions

Java provides a shorthand way of converting number primitives into number objects. Here I explain ‘boxing’ and ‘unboxing’.

Autoboxing and unboxing

We use strings all the time in our programs so it’s worth considering what a string actually is.


More core features of Java

Types and packages
3 questions
+ Object Orientation
6 lectures 44:27

Java is an object oriented programming language. What does that mean and why does it matter?

Preview 03:59

What are classes and how are they used to create objects? That’s the subject of this lesson.

Classes and objects

Here we find out how to create a ‘family tree’ of classes in such a way that one or more classes inherit the features of another class.

Class hierarchies

In this hands-on session I’ll show you, step-by-step, how to create a Java subclass in NetBeans.

How to create a subclass

Methods are object-oriented functions. Here we look at methods in some detail and I explain method signatures and method overloading.


Sometimes it is useful to call a method without having to create an object first. In this video I explain how to do this using static or ‘class’ methods.

Static methods and variables

Java's object orientation

Classes and objects
3 questions
+ Conditional Tests and Operators
9 lectures 45:30

Operators are special symbols that are used to do specific operations such as the add­ition and multiplication of numbers. Here we look at some of the most important operators.

Preview 02:56

Here I show some examples of using the addition, subtraction, multiplication, division and remainder (modulo) operators.

Arithmetic operators

How do you test if one string is the same as another string? It’s not quite as simple as it may appear.

String equality

There are exceptions to the rule that two identical strings compared using == will return false. Here I explain why.

String equality – exceptions to the rule!

Here I explain how to take different actions by using if, else and else if to perform a series of different tests.

if..else tests

If you need to perform many tests, it is often quicker to write them as ‘switch statements’. This lesson explains how to do that.

In some of the examples in this step, I have used the && operator to mean ‘and’ and the || operator to mean ‘or’. Here I explain these logical operators and the Boolean values they test.

Logical operators and Booleans

You can combine arithmetic and assignment operations using ‘compound assignment operators’ such as += and -=, as I explain in this lesson.

Compound assignment operators

You can increment and decrement values using the ++ and -- operators. But be careful: when you assign the results of these operations, the value may differ according to the position of the operator!

Unary addition and subtraction operators

Operations to change and test values

Operators and test conditions
3 questions
+ Arrays and Collections
10 lectures 47:15

Many programs need to work with collections of objects. Here we look at the most basic type of collection, a sequential list or ‘array’ of elements.


In Java, the first element of an array is at index 0. It is vital that you understand the importance of this fact, and that is the topic of this lesson.

Zero-based arrays

In this lesson I show a simple way of creating arrays and filling them with data items all in a single line of code.

Initializing arrays

You can do operations on the items in an array using a ‘for’ loop to handle each item one by one. Here I explain the basics of ‘for’ loops in Java.

for loops

Java automatically frees up memory that is no longer needed. This is called garbage collection.

Garbage collection

Fixed size arrays may not be the best solution for programs in which lists of objects may grow in size. For such programs, Java’s ArrayList class may be a better choice.


Interfaces are like abstract classes that contain method definitions but omit the code needed to implement the methods. This lesson explains the basics of Java interfaces.


Java ‘Generics’ allow the same methods to operate on objects of various types while giving your code the benefit of type-checking. Here I explain the basics. We’ll look at generics in more depth in Step Nine.


Sometimes it may be useful to index a collection of objects by something other than their numerical positions in a list. Associative arrays, hashes or Maps let you do just that.


If you need to ensure that only keys and values of specific types are permitted to be added to hashes or Maps you can used a typed HashMap.

Type-safe HashMaps

How to enforce type-checking on list elements

ArraysLists, HashMaps and generics
3 questions
+ Loops
12 lectures 47:12

When you want to repeat actions, you may need to ‘loop’ over some blocks of code. Here I take a closer look at for loops to count up and down or iterate through array items.

for loops revisited

Here we look at another type of for loop that lets you process the items in a linear collection or array in a similar way to ‘foreach’ loops in other languages.

Enhanced for statements

When you need to loop an unknown number of times, a while loop may be a good choice. A while loop continues to execute as long as some test condition remains true.


Here is an example of how you might use a while loop to read data from files of various sizes stored on your computer’s disk.

while loop to read text file

Sometimes you may want to be sure that the code in a loop is run at least once. In such a case you might want to use a do..while loop.


You can even create an array containing arrays as its elements. In this lesson I explain the essential feature of multidimensional arrays in Java.

Multidimensional arrays

When one array contains ‘nested arrays’ as its elements, how can you get at the elements inside each nested array? That’s the subject of this lesson.

Iterating over multidimensional arrays

Sometimes you may want to break out of a loop immediately. One way of doing that is by using the break keyword.


Sometimes you may want to break out of a loop once only and then carry on running the loop. One way of doing that is by using the continue keyword.


Using break or continue can change the logic of your code. Here I explain the problem and consider one way of avoiding it.

Disadvantages of break and continue

If you break out of one loop nested inside another loop, which of the two loops do you break from? That’s explained in this lesson.

Breaking out of a nested for loop

If you want to break out of both an inner loop and an outer loop you can use labelled breaks. But use with extreme caution or you may regret it!

Labelled break

The art of repetition

3 questions
+ Enumerated types, interfaces and scope
9 lectures 42:47

You can clarify your code by creating lists of named constants – for example, Hearts, Diamonds, Clubs and Spades in a gambling program. Here I explain how to do that using enums.


Sometimes you may want to give specific values to the constants in an enum. Here I show how I created an int constant in the Directions enum of my adventure game.

Enums and static constants

In Java, unlike in many other languages, Enums are classes. You can even give them their own methods! This video explains.

The Enum class

I’ve created a project from example code supplied by Oracle. But I can’t understand exactly how it works. Now is a good time to use the NetBeans debugger.

Debugging code

We looked very briefly at Interfaces in Step 6. Interfaces may declare ‘empty’ methods that define a ‘contract’ with the classes that implement the Interface. Here I explain how this works.


There may be occasions when you want to create your own interfaces to be implemented by various different classes. Here I explain how to do that.

A custom interface

Variables in your Java programs are all ‘visible’ within certain limits. Those limits define their ‘scope’.


What happens when a variable name is repeated in different ‘scope’ levels? Let’s find out!

Local variables

You can restrict the visibility of methods by declaring them using the keywords private, public or protected.

Access modifiers

Enumerated types and abstract classes

Enums and interfaces
3 questions
+ Generics and Exceptions
10 lectures 51:29

Generic classes let you work safely with lists of objects of a specified type. Amongst other things, this can help avoid problem that might occur when you add objects of mixed types to a list.

Introducing Generics

If you want to use an ArrayList which will only accept elements of a certain type – for example, Strings but not Integers – you can do so. That’s what this lesson is about.

Strongly-typed lists

Generic ‘type parameters’ are placeholders that can be replaced with real types when you create objects from a generic class.

Generic type parameters

You can write your own generic classes from which objects can be created to call the same generic methods on different types of data.

Generic classes

Generics are often used to manipulate the elements of lists and other types of collection. Here I explain how to create a custom generic list class.

Generic collections

Sometimes you may want different methods with the same name in ancestor and descendent classes – that’s method overriding.

Overriding methods

Sometimes you may want different methods with the same name but different arguments in the same class – that’s method overloading.

Overloading methods

Sometimes an error may occur when the program is running. You can deal with many types of error by handling exceptions.


You can ‘catch’ an exception object to access its methods and properties.

Catching exceptions

Here I explain how to catch specific types of exception.

Exception types

More on generic collections - and handling errors

Generics and exceptions
3 questions
+ Files and Serialization
7 lectures 26:18

Most programs need to write and read data to and from files. That’s this lesson’s topic.


Random-access files let you find data by ‘seeking’ to a specific position.

Random access files

A stream is a flow of bytes from one place to another. Java lets us save all kinds of data into streams.


Serialization is a powerful technique which lets you save an object data into streams.


Let’s see if we can save all the objects and their links to other objects in my adventure game into a file.

Saving serialized objects to disk

Having saved a network of object data to disk we now need to find a way of restoring that data and recreating the objects.

Restoring serialized objects from disk

Saving and loading data

Files and IO
3 questions

So that’s it. We’ve come to the end of this Java course. Let me wish you success in your future Java programming.

And finally...
  • How to use a PC or Mac

Java is one of the most important of all computer programming languages. But learning Java can seem like a daunting task. Not any longer! With this course you will learn Java step-by-step, from the basics right through to advanced topics. This course is, quite simply, the fastest, easiest way to learn Java programming.

The course instructor Huw Collingbourne has already taught over 22,000 people to program on Udemy. This Java Programming Master Course includes over 85 videos to explain every topic in detail. All the source code is provided in sample programs ready-to-run on a PC or a Mac. And there is even a 125-page eBook, The Little Book Of Java, to provide even more information on all the topics discussed.

If you want to master Java programming quickly and easily, this is course for you.

What you will learn

  • The fundamentals of programming – from the ground up
  • How to program Java on a Mac or on Windows
  • The nitty-gritty details of the Java language
  • Advanced topics such as generics, exception-handling, streams and serialization

Who should take the course

  • Beginners – if you've never coded before, you can learn Java step by step
  • Programmers switching to Java from some other language such as Ruby, Python, C or C#
  • Cross-platform developers – Java programs run on all major operating systems
  • Anyone who wants to make a career in programming
Who this course is for:
  • Beginners – if you’ve never coded before, you can learn Java step by step
  • Programmers switching to Java from some other language such as Ruby, Python, C or C#
  • Cross-platform developers – Java programs run on all major operating systems
  • Anyone who wants to make a career in programming