Skip to content

JAVA: Read/Write objects from JSON files. Extra implementation: r/w other type of files (.dat, .txt)

Notifications You must be signed in to change notification settings

Kostisef/json-file-handler-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JAVA: Read/Write JSON files (or other types)

FileHandler.java

Contains all the function to read/write simple files (e.x. .txt or .dat)

JSONHandler.java

Contains all the functions to handle properly the JSON reading and writing

Student.java

Contains the Student class for the JSON example

Main.java

the main method

Prerequisites

To use this package you need to have:

  • JSON in Java [package org.json] (v.20210307) (https://github.com/stleary/JSON-java), as external library to your project
  • JAVA Project SDK: openjdk-17 (17 - Sealed types, always-strict floating-point semantics)

JSON example

{
  "STUDENTS": [
    {
      "Courses": [
        "Applications of TinyML",
        "JavaScript",
        "Algorithms"
      ],
      "Age":     55,
      "Name":    "John Doe"
    },
    {
      "Courses": [
        "Introduction to Computer Science",
        "Big Data Systems",
        "Dynamic Web Applications"
      ],
      "Age":     25,
      "Name":    "Adison Lee"
    },
    {
      "Courses": [
        "Data Science: Machine Learning",
        "Fundamentals of TinyML",
        "Deploying TinyML"
      ],
      "Age":     38,
      "Name":    "Lucy Hinton"
    }
  ]
}

About

JAVA: Read/Write objects from JSON files. Extra implementation: r/w other type of files (.dat, .txt)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages