November Black Friday C# week
Black friday is here! Get up to 80 % extra points for free! More info
Only this week up to 80 % off on C# courses. More info

Files and I/O in Java

An on-line course about working with files in Java. Also teaches exceptions and formats like txt, csv, xml, and binary files.

Lessons

Exceptions In Java

Lesson 1 - Exceptions In Java

This tutorial is all about exceptions in Java, try-catch blocks, the finally construct and the TWR notation. It prepares you for file operations.
FreeUnratedWritten by David Capka
Introduction to working with files in Java

Lesson 2 - Introduction to working with files in Java

The tutorial introduces you to working with files in the Windows OS as well as writing privileges, UAC, and the use of the AppData folder in our Java apps.
FreeUnratedWritten by David Capka
Working with text files in Java

Lesson 3 - Working with text files in Java

In the tutorial, we'll work with text files (.txt extension) in Java via the BufferedWriter and BufferedReader classes for writing, reading, and appending.
FreeUnratedWritten by David Capka
Storing objects in the CSV format in Java

Lesson 4 - Storing objects in the CSV format in Java

In this tutorial, we'll create a fully-featured Java form application with a user database that stores instances to a text file in the CSV format.
FreeUnratedWritten by Petr Štechmüller
Storing objects in CSV format in Java, part 2

Lesson 5 - Storing objects in CSV format in Java, part 2

In this tutorial, we'll finish our object-oriented Java form application which stores users into a CSV file.
FreeUnratedWritten by Petr Štechmüller
Exercises for Java Files Lessons 1-5

Exercises for Java Files Lessons 1-5

Solved programming tasks in Java on text files. Tasks are ordered by difficulty. Solutions are available for download.
PremiumUnratedWritten by Petr Štechmüller
Introduction to the XML File Format in Java

Lesson 6 - Introduction to the XML File Format in Java

In this Java tutorial, we'll introduce the XML format, describe its structure, provide a sample file and mention the advantages over text files (CSV).
FreeUnratedWritten by David Capka
Writing XML Files via the SAX Approach in Java

Lesson 7 - Writing XML Files via the SAX Approach in Java

In this Java tutorial, we'll create an XML with several users using SAX and XMLStreamWriter. We'll read instances from ArrayList and write them to XML.
FreeUnratedWritten by David Capka
Reading XML via the SAX approach in Java

Lesson 8 - Reading XML via the SAX approach in Java

In this tutorial, we'll load an XML file with multiple users using the SAX approach (by XmlStreamReader). We'll instantiate items from the file to a list.
FreeUnratedWritten by David Capka
Working with XML files using the DOM approach in Java

Lesson 9 - Working with XML files using the DOM approach in Java

In this tutorial, we'll work with XML files using the DOM approach in Java. We'll read objects from XML and then create an XML file using DOM as well.
PremiumUnratedWritten by David Capka
Serialization and Deserialization in Java

Lesson 10 - Serialization and Deserialization in Java

A tutorial on how to serialize and deserialize objects in Java demonstrated on an application with users that uses serialization to store data.
PremiumUnratedWritten by Petr Štechmüller
Exercises for Java Files Lessons 6-10

Exercises for Java Files Lessons 6-10

Solved Java programming tasks on XML files, StreamAPI, and serialization. Tasks are ordered by difficulty. Solutions are available for download.
PremiumUnratedWritten by Petr Štechmüller
Binary Files in Java

Lesson 11 - Binary Files in Java

This Java tutorial introduces you to binary files and the DataOutputStream and DataInputStream classes. We'll learn to read and write instances in binary.
PremiumUnratedWritten by Michal Čápka
Exceptions and Errors in Java for the Second Time

Lesson 12 - Exceptions and Errors in Java for the Second Time

We'll look in detail at the try-catch Java construct, what an exception is and how the hierarchy of errors and exceptions is implemented.
PremiumUnratedWritten by Matej Kripner
Exceptions in Java for the third time and more techniques

Lesson 13 - Exceptions in Java for the third time and more techniques

We'll look at exception chaining, exception wrapping, the suppressed exceptions mechanism, and briefly at pluggable exception handlers.
PremiumUnratedWritten by Matej Kripner
Working with files and folders in Java

Lesson 14 - Working with files and folders in Java

The tutorial describes the File class, which is used to manipulate files and folders in the Java programming language.
FreeUnratedWritten by Petr Štechmüller
Working with files and folders in Java - New API

Lesson 15 - Working with files and folders in Java - New API

In the second part of working with files and folders in Java, we'll introduce the new API and its classes.
PremiumUnratedWritten by Petr Štechmüller
Working with custom files in Java - Zip archive

Lesson 16 - Working with custom files in Java - Zip archive

This tutorial describes how to save files with custom extension using Java ZIP archives. We'll create our own file format and form for storing employees.
FreeUnratedWritten by Petr Štechmüller
Working with custom files in Java - Saving and loading ZIPs

Lesson 17 - Working with custom files in Java - Saving and loading ZIPs

In this tutorial, we'll save a file with a custom *.emp extension and load it afterwards. We'll learn how to work with ZIP folders in Java.
PremiumUnratedWritten by Petr Štechmüller
Java - Writing/reading data types to/from Windows registry

Lesson 18 - Java - Writing/reading data types to/from Windows registry

In this article, we'll show how to store information in your computer so that it's available when you run the Java program again.
FreeUnratedWritten by Robert Michalovic
Universal access to the AppData folder in Java

Universal access to the AppData folder in Java

In this tutorial, we'll show how to access the appdata folder for application data universally using a third-party library. All in Java.
FreeUnratedWritten by Petr Štechmüller
Playing sounds (wav files) in Java

Playing sounds (wav files) in Java

The article will show basic work with wave audio files in Java. We'll show new packages, new classes, and how FileDialog works.
FreeUnratedWritten by David Capka


 

Activities (2)