Skip to content

Instantly share code, notes, and snippets.

View Scetra's full-sized avatar

Scetra

View GitHub Profile
@Scetra
Scetra / 1.java
Created December 15, 2016 02:05
Introduction To Serialization Section #1
public class PatientCat // We'll use this class to keep track of each cat patient's medical information
{
// Needed Fields
private final UUID uuid; // Prevent collisions with other cats (Sometimes cat's will have the same name, odd isn't it?)
private final String name; // Gives us an easier way of referring to a cat
private final int age; // How old the cat is (in 'human years')
private Allergy[] allergies; // An array containing the cat's allergy information.
private MedicalNote[] medicalNotes; // An array containing the cat's medical information. (Can be broken bones, tumors, infections, etc.)
//Pretty basic constructor. All we're doing here is creating a cat object with all the parameters we need.
@Scetra
Scetra / allergy-1.java
Last active December 14, 2016 03:23
[Tutorial] Intro to Serialization Method #3
public class Allergy
{
private String description;
private int duration;
public Allergy(String description, int duration)
{
this.description = description;
this.duration = duration;
}
@Scetra
Scetra / allergy-1.java
Created December 13, 2016 18:06
[Tutorial] Intro to Serialization Method #3
public class Allergy
{
private String description;
private int duration;
public Allergy(String description, int duration)
{
this.description = description;
this.duration = duration;
}
@Scetra
Scetra / allergy-1.java
Last active December 13, 2016 05:08
[Tutorial] Intro to Serialization Method #2
public class Allergy
{
private String description;
private int duration;
public Allergy(String description, int duration)
{
this.description = description;
this.duration = duration;
}
@Scetra
Scetra / cat-1.java
Last active December 13, 2016 04:42
[Tutorial] Intro to Serialization Method #1
public class Cat
{
private String name;
private int age;
public Cat(String name, int age)
{
this.name = name;
this.age = age;
}