We may earn an affiliate commission when you visit our partners.
Course image
John Purcell

This course assumes no prior programming knowledge, just a desire to learn to program.

Enroll now

What's inside

Syllabus

Introduction
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.
Read more
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.
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.
Some ideas about how best to learn Java and how to work through this course.
Programming Core Java

Create a simple Java program with Eclipse.

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.

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

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.

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

"If"

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

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.
The switch statement lets you choose between multiple alternatives.
How to use arrays in Java; creating, accessing and iterating through arrays. Also, a look at the difference between a value and a reference.
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.
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.
It's finally time to take a look at classes and objects, the main building blocks of OO (Object Oriented) programming.

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 ..

In this tutorial we'll look at returning values from methods, including the standard "get method", "getter" or "accessor" form.
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 ...
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.
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).
A tutorial on the static keyword in Java. We'll also take a look at "final".
It's time to take a closer look at the important topic of formatting and combining strings ....
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.
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.
Packages allow you to organise your Java code, in a hierarchical structure exactly like the folder structure on your computer.
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 ...
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.
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).
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.
Let's take a look at how to change one kind of number into another.
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 :) 
Generics allow you to use and create classes that work with objects, the type of which you can specify when you use "new".
If you want to pass templated objects to methods, you might want to make use of some interesting syntax ....
Anonymous classes look a bit weird at first, but they can really help to streamline your code.
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.
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.
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.
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.
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).
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.
The Java 7 Try-With-Resources syntax can massively simplify your file reading/writing code.
A tutorial on writing text files. Which is very similar to reading text files.

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

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/
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/
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/
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.

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.

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.

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).

The Java Collections Framework
The ArrayList class takes the work out of using arrays, by providing you with a resizeable array object.

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.

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.
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.
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.
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 ....
A common requirement for a list is to sort it in some kind of order. Fortunately Java makes sorting very easy.
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.
Queues are used less often than lists, sets and maps, but they're still very useful; especially if you're doing any multi-threading.
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.
If you implement Iterable, you'll be able to iterate over your own custom collection.
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.
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.
Appendix
My favourite Eclipse shortcuts.
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.
Ten tips that every programmer should know (and hopefully the professionals already do!). These tips WILL, if followed, hugely increase your productivity.
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.
What's New In Java 8?

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.

Tests
Basic Java Programming: Test Your Knowledge
Source Code
Bonus
Bonus: Learn Advanced Java

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Teaches essential programming concepts, including variables, data types, and control flow
Provides a comprehensive introduction to Java programming for absolute beginners
Taught by an experienced instructor with a strong reputation in Java education
Covers fundamental Java programming concepts in a clear and concise manner
Suitable for students with no prior programming experience
Provides hands-on practice through exercises and examples

Save this course

Save Java Tutorial for Complete Beginners to your list so you can find it easily later:
Save

Reviews summary

Hands-on java practice

According to students, this beginners course focuses more on doing rather than explaining concepts. Some learners feel that more conceptual knowledge, like OOP concepts, is needed.
Course focuses more on practice and doing rather than explaining.
"This course stresses more on doing rater than explaining concepts."
Course doesn't go into enough conceptual knowledge, like OOP concepts.
"I believe for a complete beginner some conceptual knowledge like OOP concepts is also required along with hands-on work."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Java Tutorial for Complete Beginners with these activities:
Complete Java for Complete Beginners: Part 1 in Udemy
Start with a comprehensive Java tutorial to build a solid foundation for this course by introducing the Java for Complete Beginners course from Udemy.
Show steps
  • Enroll in the Java for Complete Beginners course on Udemy.
  • Watch the first video in the course.
  • Complete the exercises in the first video.
Read Head First Java, 2nd Edition
Gain a comprehensive understanding of Java fundamentals by reading this highly acclaimed book, which provides a unique and engaging learning experience.
Show steps
  • Purchase or borrow Head First Java, 2nd Edition.
  • Read the first chapter.
  • Complete the exercises in the first chapter.
Create a simple Java program
Reinforce your understanding of Java basics by creating a simple program that utilizes variables, data types, and operators.
Browse courses on Java Programming
Show steps
  • Set up your Java development environment.
  • Create a new Java project.
  • Write a simple Java program that prints "Hello, world!"
  • Compile and run your program.
Five other activities
Expand to see all activities and additional details
Show all eight activities
Practice using loops in Java
Improve your grasp of flow control by practicing the use of loops in Java.
Browse courses on Java Programming
Show steps
  • Create a Java program that uses a for loop to print the numbers from 1 to 10.
  • Create a Java program that uses a while loop to print the numbers from 10 to 1.
  • Create a Java program that uses a do-while loop to print the numbers from 1 to 10.
Attend a Java programming workshop
Immerse yourself in Java programming by attending a workshop that provides hands-on experience and expert guidance.
Browse courses on Java Programming
Show steps
  • Find a Java programming workshop in your area.
  • Register for the workshop.
  • Attend the workshop and actively participate in the activities.
Complete Intermediate Java Programming in Udemy
Deepen your understanding of Java by exploring intermediate concepts, such as object-oriented design and data structures in this Udemy course.
Browse courses on Java Programming
Show steps
  • Enroll in the Intermediate Java Programming course on Udemy.
  • Watch the first video in the course.
  • Complete the exercises in the first video.
Build a Java application with a graphical user interface
Apply your Java skills to create a practical application with a user-friendly graphical interface.
Browse courses on Java Programming
Show steps
  • Design the user interface for your application.
  • Create the Java code for your application.
  • Compile and run your application.
Mentor a beginner Java programmer
Solidify your knowledge by mentoring someone new to Java programming, providing guidance and support as they embark on their learning journey with Java.
Browse courses on Java Programming
Show steps
  • Identify a beginner Java programmer who would benefit from your mentorship.
  • Schedule regular meetings to provide guidance and support.
  • Share your Java programming resources and materials.

Career center

Learners who complete Java Tutorial for Complete Beginners will develop knowledge and skills that may be useful to these careers:
Software Engineer
Software Engineers design, develop, and maintain software systems. Java is a popular programming language used for software engineering projects and is used by many software engineers in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career in software engineering. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to create a simple software application.
Software Developer
The Java Tutorial for Complete Beginners can help you develop the skills necessary to become a successful Software Developer. This online course covers the basics of Java programming and will teach you how to create your own Java programs. As you progress through the course, you will learn about variables, data types, operators, control flow, and methods. You will also learn how to write Java code to read input from the keyboard and write output to the screen. Upon completion of this course, you will have a solid foundation in Java programming and will be prepared to start a career as a Software Developer.
Cloud Architect
Cloud Architects design and implement cloud computing solutions. Java is a popular programming language used by cloud architects in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as a Cloud Architect. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to design and implement a simple cloud computing solution.
Mobile Application Developer
Java is a popular programming language used to develop mobile applications for Android devices. This course will teach you the basics of Java programming and will provide you with the skills you need to get started with mobile application development. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to create a simple Android application.
Web Developer
There is a high demand for Web Developers with Java skills. This course provides a solid introduction to Java and can help you get started with a career in web development. Java is used for the server-side of web development, and is used by many popular websites and web applications. This course will teach you the basics of Java programming and will provide you with the skills you need to get started with web development. The course covers topics such as variables, data types, operators, control flow, and methods.
Systems Analyst
Systems Analysts design and implement computer systems. Java is a popular programming language used by systems analysts in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as a Systems Analyst. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to design and implement a simple computer system.
Computer Systems Analyst
Computer Systems Analysts design and implement computer systems. Java is a popular programming language used by computer systems analysts in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as a Computer Systems Analyst. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to design and implement a simple computer system.
Software Quality Assurance Analyst
Software Quality Assurance Analysts test and evaluate software to ensure that it meets quality standards. Java is a popular programming language used by software quality assurance analysts in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as a Software Quality Assurance Analyst. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to test and evaluate software.
Database Administrator
Database Administrators manage and maintain databases. Java is a popular programming language used by database administrators in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as a Database Administrator. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to manage and maintain a simple database.
IT Consultant
IT Consultants help businesses with their technology needs. Java is a popular programming language used by IT Consultants in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as an IT Consultant. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to solve common business problems.
Network Administrator
Network Administrators manage and maintain computer networks. Java is a popular programming language used by network administrators in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as a Network Administrator. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to manage and maintain a simple computer network.
Information Security Analyst
Information Security Analysts protect computer systems and networks from security threats. Java is a popular programming language used by information security analysts in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as an Information Security Analyst. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to protect a computer system or network from security threats.
Computer Programmer
Software development is the process of designing, creating, and maintaining computer programs. Programmers work on a wide variety of projects, from small personal applications to large enterprise systems. Regardless of the size or purpose of the project, nearly all programmers use some form of programming language to write code. Java is a general-purpose programming language that is used for a wide variety of software development projects. This course will provide you with a solid foundation in Java programming, which will help you get started in a career as a Computer Programmer. Many entry-level programming jobs require a bachelor's degree in Computer Science or a related field, but the skills you learn in this course can help you prepare for a career in programming.
Technical Writer
Technical Writers create documentation for software and other technical products. Java is a popular programming language used by technical writers in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career as a Technical Writer. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to write clear and concise documentation.
Data Scientist
Data Scientists use programming languages to analyze data and extract insights from it. Java is a popular programming language used for data science and is used by many data scientists in their work. This course will provide you with a solid foundation in Java programming and will help you get started with a career in data science. The course covers topics such as variables, data types, operators, control flow, and methods. You will also learn how to use Java to read data from files and databases and how to perform basic data analysis tasks.

Reading list

We've selected ten books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Java Tutorial for Complete Beginners.
A collection of best practices and design patterns for Java programming. It provides practical advice on how to write clean, efficient, and maintainable code.
A collection of best practices and design principles for software development. It provides practical advice on how to write clean, efficient, and maintainable code.
A comprehensive guide to design patterns in Java. It provides practical advice on how to use design patterns to write clean, efficient, and maintainable code.
A comprehensive guide to refactoring code. It provides practical advice on how to improve the design and quality of your code.
A comprehensive guide to concurrency and multithreading in Java. It covers a wide range of topics, from basic concepts to advanced techniques.
A comprehensive reference guide for Java programming that covers a wide range of topics, from basic syntax to advanced concepts. It valuable resource for both beginners and experienced programmers alike.
A comprehensive guide to concurrency and multithreading in Java. It covers a wide range of topics, from basic concepts to advanced techniques.
A beginner-friendly introduction to Java programming that covers the basics of the language and its key concepts. It is written in a humorous and engaging style, making it a good choice for those who are new to programming.

Share

Help others find this course page by sharing it with your friends and followers:
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser