Java Tutorials

Throughout my tutorials I will teach you Java using just Notepad and the Command Prompt. Many of these tutorials produce intentional compiler errors. Using an IDE will often fix an error prior to compiling and that is a great feature in a workplace environment. However, understanding compiler errors and what causes them is a critical skill for having a greater understanding of the java programming language.

Please take a minute to read the Getting Started page to ensure that you have all the necessary software and configurations installed properly. GettingStarted


Tutorial Description
Install JDK - Windows 7 and 8.1 Instructions on installing and configuring the Java Development Kit (JDK).
Install JDK - Windows 10 Instructions on installing the Java Development Kit (JDK).
Configure JDK - Windows 10 Fix the 'javac' not recognized error.
Hello World Very simple java class to display "Hello World" to the console.
Source File Names The importance of how to properly name source code files.
Comments Types of Java comments and how to use them.
Variables/Data Types Short introduction to Variables and Primitive Data Types
Semicolons and Indentation Semicolons explained and the importance of indentation.
Variable/Identifier Naming Naming conventions and rules for variables names (identifiers).
Relational Operators The equality operators are used to compare two operands and return a true/false value.
If Statement Learn how relational operators determine program flow by returning true/false evaluations.
++ and -- Operators Understand the importance of the Increment and Decrement operators.
For Statement The for flow control statement performs repetitive statements.
Char Data Type Learn what Unicode is and how it pertains to the char data type
String Intro Learn the basics of the Java String class.
Literals Overview An overview of what literals are and how they can be represented.
Decimal Literals Decimal literals and the data types they can be assigned to.
Binary Literals Binary literals and the data types they can be assigned to.
Octal Literals Octal literals and the data types they can be assigned to.
Hexadecimal Literals Hexadecimal literals and the data types they can be assigned to.
Floating-point Literals Floating-point literals and the data types they can be assigned to.
Character Literals Character literals and the data types they can be assigned to.
Escape Sequences Learn what escape sequences are and how to use them properly.
String Literals Learn how to use string literals properly.
Initializing Variables General info on initializing variables.
Logical Operators: && || Learn about the short-circuit logical operators: && (and), || (or)
Logical Operators: & | Learn about the logical operators: & (and), | (or)
Logical Operator: ! Learn about the logical operator: ! (not)
Logical Operator: ^ Learn about the logical operator: ^ (xor)
Data Type Conversions Learn about primitive numeric type conversions
Type Casting Learn about primitive numeric type casting
Type Promotion Learn about primitive numeric type promotion in expressions
Class Introduction A class is a template or blueprint from which objects are created. Say what?
Instance Variables Learn about the concept of an Instance Variable.
Single-Dimensional Arrays Learn about single-dimensional arrays.
Enhanced For Statement Learn about how to use the enhanced for statement.
Introduction to Methods Learn about the structure and use of methods.
Main Method Parameter The main method String array parameter.
Variable Scope Intro Introduction to the concept of variable scope.
Switch Statement Part 1 Part 1 of learning to use the Switch statement.
Switch Statement Part 2 Part 2 of learning to use the Switch statement.
Simple Console Input Learn how to receive input from the console.
While Loop Statement Learn about the flexibility of the while loop statement.
Do-While Statement Learn about the do-while loop statement.
Ternary Operator Learn how to use the ternary operator ? :
Multiple Class/One File In Java, you can have multiple classes in a single source code file.
Create Object/Own Class Creating objects from their own class.
Encapsulation Part 1 Introduction to the concept of encapsulation.
Encapsulation Part 2 Learn how the principle of encapsulation works.
Nested Loops Learn how the create nested loops.
Break Statement Learn about the labeled and unlabeled break statement.
Continue Statement Learn about the labeled and unlabeled continue statement.
Reference Variables Learn about declaring and assigning reference variables.
Constructors Part 1 Introduction to class constructors and why they are necessary.
The New Operator Discover why the new operator is the key to creating objects.
Constructors Part 2 Constructor declarations can take parameters.
Constructors Part 3 Learn how to access object members without using reference variables.
Constructors Part 4 Learn about the default constructor and why it is important.
Constructor Overloading Constructor overloading solves problems with class scalability.
This Keyword Part 1 Learn how to use the this keyword to access instance variables.
This Keyword Part 2 Learn how to use the this keyword to invoke other constructors.
Constructors Part 5 Learn more about constructor overloading.
Method Overloading Part 1 Method overloading is another cool tool to solve issues with program scalability.
Method Overloading Part 2 See how Type Promotion affects method overloading.
Garbage Collection An introduction to the automatic memory management feature - the garbage collector.
Finalize Method Learn about the shortcomings of the unreliable finalize() method.
Introduction to Inheritance Learn a little about what Inheritance is and how it works.
Superclass and Subclass Learn about the relationship between a superclass and a subclass.
Superclass Constructors The subclass can invoke the superclass constructor(s) by using the super keyword.
Super Keyword The super keyword can access and invoke superclass members.
Overriding Methods Overriding methods is a really cool feature of object-oriented programming.
Super/Override Methods Learn about the super keyword and overriding methods.
@Override Annotation Learn about the @Override annotation.
The Object Class The Object class - the granddaddy of all Java objects.
Final Methods Final will prevent a method from being overridden in a subclass.
Final Primitive Variables Learn about the rules of applying the final keyword to a primitive variable.
Pass Variables to Methods Learn how Java supports only the pass-by-value technique.
Final Reference Variables Learn about the rules of applying the final keyword to a reference variable.
Final Classes Learn about the rules of applying the final keyword to a Class.
Two-Dimensional Arrays Learn how to create and read a two-dimensional array.
Introduction to Packages Learn about what packages are.
Packages Part 1 Learn about using classes and methods from other packages.
Packages: Import Statement Learn about the import statement to make your life easy.
Package Naming Conventions Learn about the package naming conventions.
Packages: Access Modifiers Learn about how access modifiers control security throughout packages.
Public Class Learn about how the access modifier public will affect a class.
No-Modifier/Default Class Learn about how the no access modifier (default) will affect a class.
Protected Class Learn why not to apply the protected modifier to a class.
Private Class Learn why not to apply the private modifier to a class.
Public Constructor Learn about how the access modifier public will affect a constructor.
Default Constructor Learn about how no access modifier (default) will affect a constructor.
Protected Constructor Learn about how the access modifier protected will affect a constructor.
Private Constructor Learn about how the private access modifier will affect a constructor.
Public Method Learn about how the public access modifier will affect a method.
Default Method Learn about how no access modifier (default) will affect a method.
Protected Method Learn about how the protected access modifier will affect a method.
Private Method Learn about how the private access modifier will affect a method.
Public Instance Variable Learn about how the private access modifier will affect an instance variable.
Default Instance Variable Learn about how no access modifier (default) will affect an instance variable.
Protected Instance Variable Learn about how the protected access modifier will affect an instance variable.
Private Instance Variable Learn about how the private access modifier will affect an instance variable.
Static Modifier Introduction An introduction to the static keyword.
Static Methods Part 1 Part 1 of my static methods tutorial.
Static Methods Part 2 Part 2 of my static methods tutorial.
Instance Block Part 1 Learn what an instance initialization block is and how to use it.
Instance Block Part 2 Learn what an instance initialization block is and how to use it.
Static Initialization Block Learn what a static initialization block is and how to use it properly.
Abstract Modifier Intro Introduction to abstract methods and classes.
Abstract Modifier Rules Learn about the rules for properly using the abstract modifier.
Introduction to Interfaces Introduction to the interface.
Interface Variables Rules for variables inside of an interface.
Interface Modifiers Learn about valid modifiers for an interface.
Subinterfaces and Superinterfaces Learn about Subinterfaces and Superinterfaces.
Interface: Abstract Methods Learn about abstract methods in an interface.
Interface: Default Methods Learn about default methods in an interface.
Interface: Static Methods Learn about static methods in an interface.
String Class Part 1 Learn the details of one of the most popular classes in Java.
String Class Part 2 Learn how a String object becomes immutable.
String Class Part 3 Learn about the String Literal Pool.
String concat() Method Learn about the concat() method in the String class.
String length() Method Learn about the length() method in the String class.
String equals() Method Learn about the equals() method in the String class.
String substring() Method Learn about the substring() methods in the String class.
String contains() Method Learn about the contains() method in the String class.
String replace() Method Learn about the replace() methods in the String class.
String split() Method Learn about the split() methods in the String class.
String valueOf() Method Learn about the valueOf() methods in the String class.
Varargs Part 1 Variable-Length Argument Arrays or Varargs for short. Part 1
Varargs Part 2 Variable-Length Argument Arrays or Varargs for short. Part 2
Primitive Wrapper Classes Introduction to the the eight primitive wrapper classes.
Autoboxing and Auto-unboxing Learn about the built in features of Autoboxing and Auto-unboxing.
Integer Class Learn just about everything in the Integer wrapper class.
Integer equals() == Learn about the differences bewteen equals() and ==
Byte Class Learn just about everything in the Byte wrapper class.
Short Class Learn just about everything in the Short wrapper class.
Long Class Learn just about everything in the Long wrapper class.
Polymorphism Introduction An introduction to the concept of polymorphism.
Polymorphism Part 1 Part 1 of my polymorphism mini-series.
Polymorphism Part 2 Part 2 of my polymorphism mini-series.
Polymorphism Part 3 Part 3 of my polymorphism mini-series.
Polymorphism: Instance Variables Does polymorphism apply to instance variables?
Overriding Instance Methods Polymorphism Instance Method Overriding Rules Tutorial.
Exception Handling Intro Learn about the tools for exception handling.
Exceptions: The Call Stack Learn about a key concept to exception handling, the call stack.
Exceptions: Try and Catch Learn about two of the core concepts for exception handling.
Try/Catch IndexOutOfBoundsException Learn about one of the most common exception classes.
Try/Catch ArithmeticException Learn about the ArithmeticException class.
Exceptions: Finally Block Learn about the finally block.
Try/Catch NumberFormatException Learn about the NumberFormatException class.
Creating Exceptions Learn about creating your own custom exception classes.
Checked/Unchecked Exceptions Learn about the differences between checked and unchecked exceptions.
Exceptions: Throw Keyword Learn about the throw keyword.
Exceptions: Throws Keyword Learn about the throws keyword.
Rethrowing an Exception Learn about rethrowing exceptions.
Exceptions: Multi-catch Block Learn about the multi-catch block.
Exceptions: Method Overriding Learn about method overriding with regards to exception handling.
Introduction to Generics Introduction to a really cool feature ... generics.
Generics: Bounded Types Learn about bounded type-variables.
Generic Methods Learn about generic methods.
Lambda Expressions Introduction An introduction to Lambda Expressions.
Lambda Block Body An introduction to Lambda Expressions with a code block body.
Lambda and Generic FI An introduction to Lambda Expressions and Generic Functional Interfaces.
StringBuilder Introduction An introduction to the StringBuilder class.
StringBuilder append(...) Method Learn all about the StringBuilder append() method.
StringBuilder insert(...) Method Learn all about the StringBuilder insert() method.
StringBuilder Common Methods In this tutorial I demonstrate some common StringBuilder methods.
ArrayList Introduction In this tutorial I introduce you to the ArrayList class.
ArrayList Constructors In this tutorial I will demonstrate the ArrayList constructors.
ArrayList add(...) Method Learn all about the ArrayList add(...) method.
ArrayList addAll(...) Method Learn all about the ArrayList add(...) method.
ArrayList forEach(...) Method Learn all about the ArrayList forEach(...) method.
ArrayList clear() and clone() Learn all about the ArrayList clear() and clone() methods.
ArrayList Common Methods Learn about some of the ArrayList simple common methods.
ArrayList remove(...) Method Learn all about the ArrayList remove(...) method.
ArrayList removeAll(...) Method Learn all about the ArrayList removeAll(...) method.
ArrayList removeRange(...) Method Learn all about the ArrayList removeRange(...) method.
ArrayList removeIf(...) Method Learn all about the ArrayList removeIf(...) method.
ArrayList replaceAll(...) Method Learn all about the ArrayList replaceAll(...) method.
ArrayList retainAll(...) Method Learn all about the ArrayList retainAll(...) method.
ArrayList sort(...) Method Learn all about the ArrayList sort(...) method.
ArrayList spliterator(...) Method Learn all about the ArrayList spliterator(...) method.
Introduction to I/O Introduction to Java Input/Output.
InputStreamReader class Learn about the InputStreamReader class.
FileReader class Demonstrate the FileReader class using the String constructor.
BufferedReader class Learn about the BufferedReader class.
OutputStreamWriter to console Demonstrate using OutputStreamWriter to the console.
FileWriter class Demonstrate the FileWriter using a String filename constructor.
BufferedWriter class Learn about the BufferedWriter class.
File class part one Part one of the File class tutorial.
File class part two Part two of the File class tutorial.
FileOutputStream class Learn about the FileOutputStream class.
FileInputStream class Learn about the FileInputStream class.
Multithreading Intro Introduction to Multithreading.
Creating a Thread 1 Creating a new Thread part one.
Creating a Thread 2 Creating a new Thread part two.
Creating a Thread 3 Spawn multiple child threads and learn about thread safety.
Creating a Thread 4 Learn how to make a thread automatically start itself.
Thread Join/States Learn about the Thread class join() method and thread states.
Synchronzied Static Methods The synchronized keyword and static methods.
Synchronzied Static Block The synchronized keyword and a static block.
Synchronzied Instance Methods The synchronized keyword and instance methods.
Synchronzied Instance Block The synchronized keyword and instance blocks.
Regex Introduction Introduction to Regular Expressions, or Regex for short.
Regex Characters Part One Part one of the regex Character classes tutorial.
Regex Characters Part Two Part two of the regex Character classes tutorial.
.wait() and .notify() methods Multi-threading with the .wait(), .notify(), and notifyAll() methods.
Enum Introduction Introduction to enumerations, or enum for short.
Common Enum Methods Common methods for enumerated lists.
Enum Constructors Enum constructors, instance variables, and methods.
Nested Classes Intro Introduction to nested classes.
Inner Classes Learn all about the regular inner class.
Local Inner Classes Learn all about the local inner class.
Anonymous Inner - Subclass Learn about anonymous inner classes that are subclasses of a superclass.
Anonymous Inner - Implements Learn about anonymous inner classes that implement an interface.
Static Nested Class Learn about static nested classes.
Overriding .hashCode() Learn what a hash code is and how to override the .hashCode() method.
Overriding .equals() Learn the steps necessary to override the .equals() method.
Object .getClass() Method Object .getClass() and Class Common Methods Tutorial.
Override .toString() Method How to properly override the toString() method.
Assertions Part 1 Learn about what an assertion is and how to use the assert keyword.
Assertions Part 2 Part 2 of the assertions tutorial.
Coupling Tutorial Learn what the term "coupling" refers to in Java.
Cohesion Tutorial Learn what the term "cohesion" refers to in Java.
InstanceofOperator Learn about the instanceof operator.
Composition Tutorial Learn what the term "composition" refers to in Java.
Aggregation Tutorial Learn what the term "aggregation" refers to in Java.
Regex String Literals Learn about regex string literals.
Regex Metacharacters Learn about regex metacharacters.
Regex Predefined Character Classes Learn about regex predefined character classes.
Regex Capturing Groups Introduction Introduction to regex capturing groups.
Regex Quantifier Introduction Introduction to regex quantifiers.
Pattern Class (Regex) Tutorial Learn about the pattern class (Regex).
Regex Capturing Group Numbering Learn about regex capturing group numbering.
Regex Group Naming Learn about regex group naming.
Regex Backreference Tutorial Learn about regex backreferences.
Regex Non-Capturing Groups Learn about regex non-capturing groups and inline modifiers.
Regex Greedy Quantifiers Learn about regex greedy quantifiers.
Regex Reluctant Quantifiers Learn about regex reluctant quantifiers.
Regex Possessive Quantifiers Learn about regex possessive quantifiers.
Regex Boundaries Learn about regex boundaries.
Java & Raspberry Pi Introduction to Java ME Embedded and Raspberry Pi.
ServerSocket & Socket Intro Learn about the ServerSocket and Socket classes.
ServerSocket & Socket Part 1 Learn more about socket communications.
BigInteger Constructors Learn about the constructors
BigInteger Basic Math Methods .add(), .subtract(), multiply(), and .divide()
BigInteger .compareTo(...) plus .toString(..) and .divideAndRemainder(...)
BigInteger .isProbablePrime() Part 1 learn about the isProbablePrime(...) methods
BigInteger .isProbablePrime() Part 2 RSA and the isProbablePrime() method
BigInteger .isProbablePrime() Part 3 Multithreading and the isProbablePrime() method

Questions, Comments, or Requests