Java Code Examples

Java examples - the fastest way to learn Java programming language. You will find here short but descriptive Java samples source code, focused on the crucial Java packages, classes and its methods. It will show you Java classes functionality with explanations how to use them, and help you in fast Java application development.

Basics

Abstract class

Java abstract class is a special type of Java classes which may contain abstract methods. (2)

Array

Java array examples. Array types, declaration, construction, initialization and array manipulation. (5)

Classes and Objects

Java class and object examples. Definitions of the Java class and Java object and how to use them. (4)

Flow control

Java control flow statements, break up the flow of execution, enabling your program to conditionally execute particular blocks of code using decision-making statements (if-then, if-then-else, switch), the looping statements (for, while, do-while), and the branching statements (break, continue, return). (5)

Hello World

Introduction to Java programming language, installation and how to create simple Java application. (2)

Interface

Java Interface examples. What is a Java Interface, syntax and how to implement methods declared in the interface? (3)

Keywords

Java programming language reserved keywords (4)

OOP concepts

Object Oriented Programming basic concepts and programming techniques. (3)

Primitive Types

Literals and ranges of all primitive data types (1)

Variables

Java variable types and their characteristics. (4)

Collections

Collection Interfaces

Core Collections interfaces - List, Set, Map, Queue. Learn how to use them and when to use each of them. (1)

Introduction

Basic Java collections terms and brief description of collections types. (1)

List

Java Collections Framework - List interface. How to use List interface and List interface implementations? (9)

Map

Java Collections Framework - Map interface. Map interface description and Map set implementations examples. (6)

Set

Java Collections Framework - Set interface. How to use Set interface and Set interface implementations? (8)

I/O

File

Java examples about creating a file, reading, writing and accessing a file (5)

Streams

Java streams examples. Types and differences of Java streams and examples how to create a stream, write data to the Java stream, and read the Java stream. (15)