Java Tutorial for Complete Beginners

Learn to program using the Java programming language
1603 reviews
TAUGHT BY
  • John Purcell Software Development Trainer

    After working as a software developer and contractor for over 14 years for a whole bunch of companies including CSC, Proquest, SPSS and AT&T in the UK and Netherlands, I decided to work full-time as a private software trainer. I now live in the beautiful city of Budapest, Hungary, from where I run the website Cave of Programming.

WHAT'S INSIDE
  • Lifetime access to 75 lectures
  • 16+ hours of high quality content
  • A community of 351000+ students learning together!
  • 2510+ discussions
SHARE

Java Tutorial for Complete Beginners

Learn to program using the Java programming language
1603 reviews

HOW UDEMY WORKS?

Discover courses made by experts from around the world.

Take your courses with you and learn anytime, anywhere.

Learn and practice real-world skills and achieve your goals.

COURSE DESCRIPTION

Learn to program in the Java programming language. This course assumes no prior programming knowledge, just a desire to learn to program.

    • Basic fluency with computers
    • Over 75 lectures and 16 hours of content!
    • Learn to program in Java
    • Anyone who wants to learn Java

THE UDEMY GUARANTEE

30 day money back guarantee
Lifetime access
Available on Desktop, iOs and Android
Certificate of completion

CURRICULUM

  • SECTION 1:
    Introduction
  • 1
    Introduction and Installation
    09:39
    Introducing the Java for Complete Beginners course, and what you need to install in order to get started. Don't worry too much about what this stuff we're installing actually does --- we'll look at that next time.
  • 2
    What Java Is and How It Works
    12:38
    In this tutorial we'll talk about such things as the Java Virtual Machine and the Java Development Kit; we'll discuss what a programming language is exactly, and how you basically make your computer do stuff.
  • 3
    Getting a Job and What to Study After Completing Basic Java
    18:59
    What should you do when you've completed a basic Java course, and can you get a job with Java? In this video I'll explain a bit about some of the major areas of advanced Java, the process of finding a job and what you might want to study next, once you've completed basic Java.
  • 4
    How To Get The Most Out Of This Course
    09:25
    Some ideas about how best to learn Java and how to work through this course.
  • 5
    Free C++ and 50% Off All My Courses
    Text
  • SECTION 2:
    Programming Core Java
  • 6
    A Hello World Program
    04:46

    Create a simple Java program with Eclipse.

  • 7
    Using Variables
    07:53

    Variables are one of the most basic essential building blocks of computer programs. We'll take a look at Java's basic types of variables here.

  • 8
    Strings: Working With Text
    09:21

    The String class allows you to work with text in Java.

  • 9
    While Loops
    07:15

    In this tutorial we'll look at how to create loops in your code so that you can execute the same lines of code repeatedly.

  • 10
    For Loops
    09:28

    "For" loops allow you to control exactly how many times your loop executes.

  • 11
    "If"
    12:26
  • 12
    Getting User Input
    08:52

    A tutorial on how to get user input in your program using the Scanner class.

  • 13
    Do ... While
    08:05
    How to use do...while loops in Java, plus variable scope and multi-line comments. I take a look at a solution to a commonly-assigned beginner's exercise in Java.
  • 14
    Switch
    06:52
    The switch statement lets you choose between multiple alternatives.
  • 15
    Arrays
    09:46
    How to use arrays in Java; creating, accessing and iterating through arrays. Also, a look at the difference between a value and a reference.
  • 16
    Arrays of Strings
    08:39
    A tutorial on arrays of Strings in Java, plus another way to iterate through an array, and more stuff on the difference between values and references.
  • 17
    Multi-Dimensional Arrays
    13:06
    How to work with multi-dimensional arrays in Java and info on how multi-dimensional arrays actually work, plus some tips on how to remember which index is which.
  • 18
    Classes and Objects
    11:44
    It's finally time to take a look at classes and objects, the main building blocks of OO (Object Oriented) programming.
  • 19
    Methods
    11:05

    Classes (and objects) can contain data and subroutines, the latter being referred to as "methods". We'll look at methods here.

    Note: there's a little error right at the end here -- I copied person1.sayHello() but didn't change it to person2 ..

  • 20
    Getters and Return Values
    10:31
    In this tutorial we'll look at returning values from methods, including the standard "get method", "getter" or "accessor" form.
  • 21
    Method Parameters
    15:00
    We've already covered returning values from methods; now we'll take a look at passing values to methods. These two techniques allow you, among other things, to create methods that process one piece of data into another ...
  • 22
    Setters and "this"
    10:58
    Setters (or set methods, or, if you have come from the 1970s in a time machine, "mutators"), allow you to change the data in your objects. We'll also take a look here at the "this" keyword.
  • 23
    Constructors
    10:18
    Constructors are a special kind of method that gets run automatically when you create an object from a class (or in the lingo, "instantiate" an object).
  • 24
    Static (and Final)
    19:46
    A tutorial on the static keyword in Java. We'll also take a look at "final".
  • 25
    String Builder and String Formatting
    19:43
    It's time to take a closer look at the important topic of formatting and combining strings ....
  • 26
    The toString Method
    11:06
    toString() is a method of the Object class, which is the ultimate parent of all objects in Java. By over-riding it, you can implement a way to create a string representation of your object.
  • 27
    Inheritance
    14:09
    Inheritance is one of the basic building blocks of OO programs. And yes, believe it or not, it is actually used in the real world -- constantly --  but perhaps most often when working with elaborate external APIs, such as Swing or servlets.
  • 28
    Packages
    14:03
    Packages allow you to organise your Java code, in a hierarchical structure exactly like the folder structure on your computer.
  • 29
    Interfaces
    19:15
    Interfaces are a vital tool in Java programming. At first you may be tempted to suspect that people only use them to show off their Java skills; but once you understand fully what they do, you won't want to do without them. Trust me on this one ...
  • 30
    Public, Private, Protected
    19:57
    Public, private and protected are Java keywords that allow you to implement "encapsulation" -- hiding away the internal mechanism of your classes, while exposing only certain selected methods the rest of your program.
  • 31
    Polymorphism
    10:04
    Polymorphism means being able to use a child class wherever a parent class is expected. For example, if you want to use a class of type Animal, you can always use a class of type Dog instead (if Dog extends Animal).
  • 32
    Encapsulation and the API Docs
    11:17
    Encapsulation is the art of hiding away the workings of a class and only exposing a public API. We'll also take a look at how to read the API docs.
  • 33
    Casting Numerical Values
    11:16
    Let's take a look at how to change one kind of number into another.
  • 34
    Upcasting and Downcasting
    13:54
    Upcasting and downcasting really test your understanding of Java references and objects. If you can understand this stuff (and yes, it's also very useful aside from testing your understanding), then you've definitely got the aptitude to make a great programmer. And if you CAN'T understand it, then stick at it :) 
  • 35
    Using Generics
    12:40
    Generics allow you to use and create classes that work with objects, the type of which you can specify when you use "new".
  • 36
    Generics and Wildcards
    17:50
    If you want to pass templated objects to methods, you might want to make use of some interesting syntax ....
  • 37
    Anonymous Classes
    08:56
    Anonymous classes look a bit weird at first, but they can really help to streamline your code.
  • 38
    Reading Files Using Scanner
    12:55
    The easiest way to read a text file is by using the Scanner class. We'll take a look at Scanner in this tutorial. Scanner basically just parses an input stream (a sequence of bytes, in other words) into lines or tokens, but it will open a file for you too if you ask it the right way.
  • 39
    Handling Exceptions
    16:23
    It's finally time to start looking at exceptions .... A major component of the Java language, and one that you're bound to run across in any sizeable program. Here we'll look at the two ways of handling exceptions and how they work.
  • 40
    Multiple Exceptions
    12:11
    You can throw more than one possible type of exception from a method, and you can catch multiple exceptions in your try-catch block We'll look at the possibilities here, and also take a look at a common interview/exam question.
  • 41
    Runtime vs. Checked Exceptions
    08:49
    So far we've looked at checked exceptions; the kinds of exception that you are forced to handle. But there are also unchecked (runtime) exceptions. These are exceptions that you can handle if you want to, but you're not forced to. Knowing about the two main kinds of exception is considered an important test of knowledge in Java.
  • 42
    Abstract Classes
    12:58
    Abstract classes allow you to define the parent class of a new hierarchy without having to worry about the user actually instantiating the parent. For instance you could create an "Animal" class just to act as the basis for "Dog", "Cat, "Sheep" and so on, even defining some functionality in "Animal", but at the same time preventing the user of your hierarchy from trying to create an "Animal" object (which after all wouldn't make much sense -- you never encounter an abstract "animal" in the real world; only particular kinds of animals).
  • 43
    Reading Files With File Reader
    17:26
    To really get serious about reading files in Java, you need to get used to stacking objects inside each other like Russian dolls. Although the code we'll examine here is complex, in the next tutorial we'll discover a Java 7 language feature that can simplify it a lot. It's also a very flexible structure for reading files, since you can read different kinds of files by changing a class or two.
  • 44
    Try-With-Resources
    11:12
    The Java 7 Try-With-Resources syntax can massively simplify your file reading/writing code.
  • 45
    Creating and Writing Text Files
    06:20
    A tutorial on writing text files. Which is very similar to reading text files.
  • 46
    The Equals Method
    17:21

    A tutorial on how to implement the .equals method for your own classes.

  • 47
    Inner Classes
    16:33
    Classes can be declared almost anywhere in Java. In particular, it's often very useful to declare either static or non-static classes within other classes.
    http://www.caveofprogramming.com/java/inner-classes/
  • 48
    Enum Types: Basic and Advanced Usage
    19:20
    The enum keyword lets you create constants that belong to a fixed set of values (think colours, animals, etc). In the first half of this video we'll look at basic usage and why we need enum, then we'll move on to more advanced usage.
    Source code: http://www.caveofprogramming.com/java/enum/
  • 49
    Recursion: A Useful Trick Up Your Sleeve
    17:26
    Recursion is a programming technique that allows you to solve certain kinds of problems very elegantly. It involves calling a method from itself. Crazy!
    Source code: http://www.caveofprogramming.com/java/recursion/
  • 50
    Serialization: Saving Objects to Files
    21:17
    Serialization is the process of turning objects into a stream of binary data; by serializing objects, you can store them in a file and restore them later from the same file, implementing saving and loading in your application.
  • 51
    Serializing Arrays
    14:42

    We can serialize entire arrays (or ArrayLists) just as easily as single objects. I'll also show you a good trick for serializing multiple objects individually in this tutorial, plus we'll talk a bit about type erasure.

  • 52
    The Transient Keyword and More Serialization
    16:14

    To finish off the stuff about serialization, we'll take a look at the transient keyword, plus a few things that might catch you out.

  • 53
    Passing by Value
    21:30

    Java only supports one method of passing values to methods, unlike, e.g. C++. We'll take a look at exactly how argument passing works in this tutorial (note: source code attached to this lecture; for other lectures, see the source attached to the final lecture).

  • SECTION 3:
    The Java Collections Framework
  • 54
    ArrayList: Arrays the Easy Way
    09:58
    The ArrayList class takes the work out of using arrays, by providing you with a resizeable array object.
  • 55
    Linked Lists
    13:56

    If you want to add items efficiently to somewhere in a list other than the beginning or end, you need a linked list.

    IMPORTANT NOTE: I had misunderstood something when making this video, as pointed out to me by "kidbabic" on YouTube among others. If you add or insert something to a LinkedList by specifying an index, the list has to iterate over all items in itself up to that point in order to find the insertion/deletion point. So adding or removing to LinkedList is only faster if you use an iterator, which you have ready pointing at the correct point. See the tutorial on iterators later on for more info.

  • 56
    HashMap: Retrieving Objects via a Key
    09:57
    Maps let you store key-value pairs, so that for example you can retrieve objects via an ID. HashMap is the most lightweight in terms of memory, and the one you'll use the most often.
  • 57
    Sorted Maps
    12:02
    If you want your map keys to be sorted, you can use special kinds of maps. A lot of what we'll cover here also applies to sets, which we'll look at shortly.
  • 58
    Sets
    15:54
    Used less often than lists or maps, sets are nevertheless great for creating collections of things that are unique --- in other words, for removing duplicates. It's also very quick to check whether a value exists in a set, whereas checking for something in a list can take a long time in computer terms.
  • 59
    Using Custom Objects in Sets and as Keys in Maps
    11:20
    If you want to use objects of your own classes in sets, or you want to use them as the keys in maps, you need to do a couple of little things ....
  • 60
    Sorting Lists
    21:29
    A common requirement for a list is to sort it in some kind of order. Fortunately Java makes sorting very easy.
  • 61
    Natural Ordering
    19:35
    How will your objects be sorted, if you sort them somehow? The sort order often depends on something called the natural order, and you can define custom natural orders for your own classes to sort them in the order you want.
  • 62
    Queues
    18:17
    Queues are used less often than lists, sets and maps, but they're still very useful; especially if you're doing any multi-threading.
  • 63
    Using Iterators
    09:25
    Iterators are the thing that enable you to get each element in a collection in sequence. We'll look at using them in this tutorial, then next time we'll move on to implementing our own.
  • 64
    Implementing Iterable
    18:55
    If you implement Iterable, you'll be able to iterate over your own custom collection.
  • 65
    Deciding Which Collection to Use
    14:24
    It's time for a review of how to choose which of the main Collection classes and types to use. In this tutorial we'll go over some stuff we learned earlier and bring it all together.
  • 66
    Complex Data Structures
    21:52
    You can use "nested" Collections objects to represent all kinds of complicated data structures in Java; maps of lists of sets of maps, etc, etc. We'll take a look at a simple example here, inspired by a university coursework question.
  • SECTION 4:
    Appendix
  • 67
    Eclipse Shortcuts
    13:12
    My favourite Eclipse shortcuts.
  • 68
    Getting a Job Extended Version: What you need, a strategy for finding work, and my story.
    30:30
    An extended video detailing my strategy for finding a job as a software developer, plus stuff about the question of whether you need experience or a degree, what you can do to increase your chances and my own personal story of how I got into software development.
  • 69
    Ten Tips for Improving Your Coding
    05:48
    Ten tips that every programmer should know (and hopefully the professionals already do!). These tips WILL, if followed, hugely increase your productivity.
  • 70
    Debugging in Eclipse
    15:36
    In this tutorial we'll take a look at using the Eclipse debugger. Debugging is useful for when your program compiles and runs but doesn't do what you expect, and you're having a hard time figuring out why. Debugging allows you to execute the program line by line and to see what values each variable in your program have at each step.
  • SECTION 5:
    What's New In Java 8?
  • 71
    Lambda Expressions
    31:55

    A tutorial on the most important new feature in JDK 8. Note, source code attached to this lecture. Source code for most other lectures is attached to the final lecture in this course.

  • SECTION 6:
    Tests
  • 72
    Basic Java Programming: Test Your Knowledge
    Text
  • SECTION 7:
    More ...
  • 73
    Recommended Books
    Text
  • 74
    Still to come ...
    Text
  • SECTION 8:
    Source Code
  • 75
    Source Code
    Text

UDEMY BY THE NUMBERS

5,200,000
Hours of video content
19,000,000
Course Enrollments
5,800,000
Students

RATING

  • 1333
  • 200
  • 30
  • 14
  • 26
AVERAGE RATING
NUMBER OF RATINGS
1603

REVIEWS

  • Joe Winfield
    I just needed to brush up on my basic Java skills, this was the perfect step.

    Between Semesters in my Mobile App Development course, I thought I needed to brush up on my Java skills so I went online and found this course by John Purcell. He explains everything really well while doing it so you understand exactly what does what in a vast array(List?!) of areas. Found his teaching effective and learnt a lot from it and feel more confident around the basics. He also supplies code samples for each topic which is great too but I'd recommend doing the work along side him.

  • Steve Voltmer
    Well Said and Explained

    I've taken quite a few on-line tutorial/courses on various languages, and that might have helped me understand this course, but I believe his approach to Java and DOM programming is well thought out and makes sense and I hope to take more of his advanced courses.

  • Yiguo Sun
    Perfect for beginner

    Very clear course, and is suit for a beginner. knowledge,and little practice. I will strongly recommend to my friends.

  • Anna Stoermer
    Great course

    Good explaination of the Java Basic. The code examples were very useful as well.

  • Alituwa Hannah
    i cant get anything

    please help mi out