From 36154a9560454aa54de954ddedbe62acd0204c13 Mon Sep 17 00:00:00 2001 From: Mehrdad Shirvani Date: Fri, 15 May 2026 17:49:01 +0330 Subject: [PATCH] docs: add README --- README.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ad5d1d3 --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +# Java Exceptions and File Handling Workshop + +## Introduction +This workshop is designed to help students become familiar with **exception handling** and **basic file operations in Java**. +It provides small demo programs and guided exercises that demonstrate how common runtime exceptions occur and how they should be handled in real applications. + +The workshop also includes a **file handling guide**, showing how Java can interact with files on the system and how to work with JSON data. + + +--- + +## Workshop Structure + +The workshop consists of two main sections: + +### 1. Exception Handling +This section contains demonstration code that intentionally produces different types of runtime exceptions. Students are expected to analyze the code and apply proper **exception handling techniques**. + +The examples include scenarios such as: + +- `NullPointerException` +- `IllegalArgumentException` +- `ArithmeticException` +- `NumberFormatException` +- `IllegalStateException` + +### 2. File Handling Guide +The second section of the workshop introduces common **file system operations in Java**. +Unlike the exception section, this part is mainly **instructional** and does not contain required exercises. + +Topics covered include: + +- **AddressingModes** + Understanding relative and absolute file paths. + +- **CreatingFiles** + How to create files programmatically using Java. + +- **DeletingFiles** + Removing files from the file system safely. + +- **ReadingFiles** + Reading data from text files using Java IO classes. + +- **WritingFiles** + Writing content to files. + +- **ParsingJson** + Basic techniques for working with JSON files in Java. + +These examples are intended to serve as **reference material** for future projects. + +--- + +## Tasks + +Students may optionally complete the following tasks: + +1. Review the provided exception demo code. +2. Identify where runtime exceptions occur. +3. Modify the `FileService` methods by: + - Uncommenting the provided code + - Adding appropriate exception handling +4. Test the program to ensure that errors are handled gracefully. + +### Important Notice +Completing and submitting this workshop is **NOT mandatory** and **does not carry any points or grading**. + +It is provided purely as a **learning exercise** to help students better understand Java exception handling and file operations. + +--- + +## Learning Goals + +By working through this workshop, students should be able to: + +- Understand common Java runtime exceptions +- Apply `try-catch` blocks correctly +- Handle file-related exceptions +- Perform basic file operations in Java +- Understand how Java programs interact with JSON files +```