O'Reilly logo
live online training icon Live Online training

Getting Started with Java: From Core Concepts to Real Code in 4 Hours

Topic: Software Development
Simon Roberts

Learning Java Basics in 4 Hours teaches core Java fundamentals quickly and easily so you can get started programming today. In this course, expert programmer and trainer Simon Roberts introduces the concepts and techniques of Java. You’ll learn the fundamental syntax and how to work with methods, classes and objects along with other key concepts.

This course is aimed at entry to mid-level programmers who have a working understanding of basic programming concepts in some other language. The topics of the course are carefully selected to give you enough of the essentials to get going, and to use as a foundation for your own research and deepening your own knowledge after the course, without laboring every last detail and variation. You’ll pick up the most-used concepts and the syntax elements that support them. The course is delivered in a highly practical style, with lots of code examples--created while you watch--that you will take away and keep. The delivery is heavy on understandability, practical usability, and light on academic formality.

What you'll learn-and how you can apply it

  • Java source file structure
  • Java program launch
  • Types, variables, expressions and operators
  • Control structures, loops and conditions
  • Structured data and classes
  • Using interfaces for generalization
  • When things go wrong, working with exceptions
  • Simple IO using files and network sockets

This training course is for you because...

  • You might be a programmer in another language, such as Python, JavaScript, or C/C++ looking to broaden your horizons
  • You might be a student about to take a course in Java, or have taken classes in other programming languages, and want to learn about another
  • You just want to find out a bit about Java


  • You should be comfortable reading procedural program code written in some other programming language (for example, Python, JavaScript, or C/C++)
  • It would be beneficial, but is not essential, for you to have some understanding of Object Oriented concepts

Materials, downloads, or Supplemental Content needed in advance:

It’s recommended that you have a development environment installed and configured with at least Java 8, but a very brief introduction to obtaining and installing the NetBeans IDE with Java will be given at the start of the course

What Is Java and Why Would I Use It? (video)

Verifying and Installing the Java Development Kit (video)

Obtaining and Installing the NetBeans IDE (video)


Source code repository on github.com will be used to distribute examples created during the course.

Watching Java Programming Basics is a great next step (video)

About your instructor

  • Simon started out working as a software engineer, specializing in industrial control systems, and had a sideline teaching for a local University in his then-home-town of Cambridge, England.

    In 1995 he joined Sun Microsystems, Inc. as a senior instructor and course developer. Simon spearheaded the introduction of Java training by Sun Microsystems in the U.K. in 1995. He developed the first Java certification exams for Sun before he moved to the U.S. in 1998.

    Since leaving Sun in 2004, Simon has developed and delivered training for clients around the world.

    Simon believes that training should have an immediate purpose and application, and that the most effective training is usually "on the job" mentoring, helping to remove the immediate roadblocks to productivity that so often plague workers in fast moving environments.


The timeframes are only estimates and may vary according to how the class is progressing

Hour 1

Getting started, an overview of unavoidable concepts and the “Hello world!” example (15 minutes)

  • Overview of installing NetBeans with Java
  • Source-files and classes
  • static methods
  • Using libraries and the import
  • How a Java program starts up
  • Introducing the String

Simple calculations (25 minutes)

  • Key Java types: numbers, boolean, and “reference” types
  • Expressions, literals, variables, and “computations”
  • Many of something: using Lists and arrays
  • A lightning tour of key operators

Control structures (20 minutes)

  • Conditions with if and case
  • Loops with while, for, and “enhanced for”

Break: 10 Minutes

Hour 2

Declaring and calling simple methods (20 minutes)

  • Declaring a static method: name, arguments, and return type
  • Providing the method implementation: local variables
  • Return values
  • Overloading methods

Representing complex ideas with classes and objects (40 minutes)

  • Representing ideas involving multiple data elements: Using a class as a data structure
  • Building and using objects: the value of “this”, instance variables and methods

Break: 10 Minutes

Hour 3

Separating what it does from how it does it (20 minutes)

  • Defining and using generalizations with interfaces

When things go wrong (20 minutes)

  • The exception concept
  • Handling exceptions
  • Throwing exceptions

Basic IO operations (20 minutes)

  • Reading files and network sockets