Skip to content

SulaimanNiazi/Java-Gson-Listeners-Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Overview

This project is a Java application where I practiced using listeners, Gson for JSON parsing, interfaces, and various Java concepts. The application manages a library of media items, including books, movies, audiobooks, and magazines. It demonstrates how to read JSON files, implement interfaces, and use the observer pattern for event handling.

Features

  • JSON Parsing: Uses Gson to parse JSON files containing information about books and movies.
  • Interfaces: Defines a Media interface and implements it in classes like Book, Movie, AudioBook, and Magazine.
  • Observer Pattern: Implements the observer pattern to notify observers about changes in the library.
  • Library Management: Manages a collection of media items and allows updating their prices.

Folder Structure

The workspace contains the following folders:

  • src: Contains the source code and JSON files.
  • lib: Contains the Gson library dependency.
  • bin: Contains the compiled output files.

How to Run

  1. Ensure you have Java installed on your system.
  2. Clone the repository and navigate to the project directory.
  3. Compile the Java files:
    javac -d bin -cp lib/gson-2.11.0.jar src/Java/*.java
  4. Run the application:
    java -cp bin;lib/gson-2.11.0.jar Java.App

Dependencies

  • Gson: A Java library used to convert Java Objects into their JSON representation and vice versa.

Customization

You can customize the folder structure by updating the settings in .

Additional Information

For more details on managing dependencies in Visual Studio Code, refer to the VS Code Java Dependency Management documentation.