Normalizing Databases

Part of a Collaboration with Lee Angioletti and Daniel Krueger

Database is one of those weird key terms, isn’t it? One of those words that tends to get thrown around by people with little actual understanding. At least that’s how it seems to me, it’s always been a general term with little meaning. It might be that way to you but databases can be more complex than you might imagine.

So what exactly is a database? In layman’s terms, a database is a collection of information that’s organized so that a computer program can easily access certain pieces of data. Relationships between this data can be represented in a table; with rows(tuples) and columns which represent the attributes of your data elements.

In this example, ID, Name, Username and Password are the attributes. In row(tuple) 3, you see that ID 3 has the Name Mike Powers, the Username mpowers and the Password mikerox.

Of course the above table is rather simple, with only a few attributes and only a few members. A problem arises once you get larger tables with many members and attributes that depend on each other. Take for example, the following table.

Notice a few things different about this table compared to the username/password table above. That table had every attribute of every member be different. Everyone had a different username or password, it was straight forward because everyone only has a singular username or password in that instance. In this table something different happens with mobile; people can have more than one cell phone number and both Jon and Lester do in this table. Also notice that Ron and Lester share the same zip, state and city. There’s some redundancy in this data. To fix that, we use a process called normalization which goes through three steps.

First Normalized Form (1NF)

The rule of 1NF holds that an attribute of a table can’t have multiple values. Of course, our table currently has multiple values; Jon and Lester have two different cell phone numbers in mobile in our table. Let’s fix that and make each attribute be in it’s own row; each column has only a single value now.

Second Normalized Form (2NF)

I should point out now: you need to have your table in the previous normalized form to move onto the next. We have our table in 1NF, so we can do 2NF and then 3NF, but you cannot skip over 2NF if you wanted to go from 1NF to 3NF and so on.

Moving into 2NF also requires that we know a couple of definitions about a few kinds of dependencies.

  • Functional Dependency: when the value of an attribute depends entirely on the value of another attribute
  • Partial Dependency: Attribute depends on only part of the primary key
  • Transitive Dependency: an indirect relationship between values in the same table; results in a functional dependency

Hmmm…yes. These words are made of words. Essentially, in our 1NF above, a functional dependency can be name which depends on id; each name value depends entirely on the id value to show the correct name.

To change our table, we actually need to identify any partial dependencies and then make a new table for those partial dependencies. Can you see a partial dependency in our 1NF table? I’ll give you a moment. ….Did you say the mobile on id dependency? That just so happened to be what the problem with multiple values too! So let’s turn our 1NF to 2NF.

Now we have two tables, one of Employee Information and one of Employee Contacts.

Third Normalized Form (3NF)

To transform our tables into 3NF, you need to remove transitive dependencies. What’s that exactly? Good news, if you’ve ever heard of transitive properties you’re halfway there! The transitive property holds that if A is greater than B and B is greater than C then we can say A is greater than C. The transitive dependency works in a similar way. How so? Let’s look at our Employee Information table. State and City are dependent on Zip code. Zip code is dependent on ID. Therefore, we can say that State and City are dependent on ID. Removing this transitive dependency also alleviates a logical consistency; Ron and Lester live in different cities and states, but share the same zip code in this example. Here are our tables in 3NF, Employee Information and Location Information.

Final Normalized Form

And that’s pretty much it! The main thought you should take away from this blog is that normalization is a process with the main goal to reduce data redundancy. More information can be found in these links: https://beginnersbook.com/2015/05/normalization-in-dbms/, https://www.lifewire.com/transitive-dependency-1019760.

Inheritance and Access Modifiers

As I mentioned in my previous post on Polymorphism, I’m not as knowledgeable on the four major features of Object Oriented Programming, known concisely as APIE. I recently had a rather foolish mistake of tying Inheritance in with Polymorphism, which may be a bit easy to do since Polymorphism does take place as a result of Inheritance, but I won’t make excuses for myself. Today we’ll talk a bit about inheritance and the impact that access modifiers make on it. (Spoiler Alert: You’ll probably see blog posts on Abstraction and Encapsulation soon just to round the four principles out!)

Inheritance is a principle in which an object acquires, or inherits, all of the properties and methods of a parent object. Why is this so important, you may ask? Well, it allows you to make new classes which are built on top of pre-existing classes; you can reuse the methods and fields of that parent class. Not only that, but you can add new methods and fields to your children objects. TLDR; inheritance can be read as a ‘is-a’ relationship. For example, a Jeep ‘is-a’ Car, a Student ‘is-a’ Human, a Dog ‘is-a’ Animal, etc.

There is something important that you have to consider when using inheritance in your projects; the access modifiers applied to your fields and methods in your parent class. True to their name, access modifiers effect how accessible the field, class or method is to other objects and classes, and the program itself. So how do the access modifiers effect inheritance? Actually, the child class will inherit all the methods and fields of it’s parent class except one; any that are declared private.

Let’s check out a quick code example for this concept. Here I have a class named Musical. It has three methods to represent properties of a musical. A public method, songs(), a protected method cast() and a private method story().

    class Musical{  
        public void songs() {
            System.out.println("La la la...");
        } 
        protected void cast() {
            System.out.println("Characters");
        } 
        private void story() {
            System.out.println("Story");
        }
    }

Next I’ll have a child class of Musical; Heathers. Notice I have gone ahead and used polymorphism to override the original definition for the method cast.

class Heathers extends Musical{  
        public void cast() {
            System.out.println("Veronica, Heather, J.D.");
        }
    }

Now let’s try and call on these methods–I’ll call on each of them within the new instance of the Heathers class and…wait a minute. My IDE is giving me an error.

What in the frick is that?!
….Ohhhhhh.

The IDE knows that story(), being a private method couldn’t be inherited from Musical to Heathers. As soon as I remove the invocation for story(), the error goes away because both the protected method cast() and the public method songs() is visible and therefore inheritable from Musical down to Heathers.

In a nutshell, that’s inheritance and how the access modifiers impact it. Access the full code used as an example in this blog here.

Java Program Components

Hey, I think sometimes we can benefit while coding high end concepts by taking a step back and examining the building blocks and frames. That is why today’s topic may seem a little short and boring, but I’ve definitely found that a lot of the time I get too hung up on what my end result should be that I don’t take enough time to worry about how I’m starting my code, the minutia that makes up just about every program. D-Did you like that big word there, minutia? Yep, that’s what I went to college for! 😀

Back to business: there’s a sort of general template that a majority of Java programs follow.

A. Opening Comment – Comment to describe the code’s purpose

/*
    This code shows the basic setup of a Java Program
    It asks the user for input and checks it
    in a if loop to return a message to the user
*/

B. Import Statement – Import any Java packages, if needed.

import java.util.Scanner; //importing the Scanner class

C. Class Declaration – the class is a user-defined blueprint to create objects from

//Name must be the same as the name of your file!
class DemoClassMethod {

}

D. Class Method Declaration – methods are blocks of code which are used to perform tasks

class DemoClassMethod {
//This is kind of empty huh? Let's declare a method!
    public static void main(String[]args) {
        /*What's all that stuff? Let's talk about it!
        1. public and static are both access modifiers
           in this method's case; 
            -public means that any class can access this method 
            despite what class it was created in
            -static means that this method doesn't
            belong to an instance of the class,
            but to the class itself
        2. void represents the return type; in this case 
           nothing is returned
        3. main() is the method's name
        4. String[]args is the parameter handed to the method.
        */
    }
}

Git Commands: init and clone

As part of your coding experience, you might be asked to use Github. Github, speaking from experience, can be pretty scary for those unsure of how you interact with it–and opening a Git Bash or other command line to do that won’t instill a comforting feeling. For myself, I’ve spent my whole-technology-connected-life navigating through the GUI(graphical user interface) of Windows to find files and programs I want to open so the text-commands to use Git were kind of scary. One wrong line and you could delete things or put them in the wrong section. Eep!

Take a deep breath–relax. Once you get to used to the various commands used to access your data, it’s not such a giant hoop to jump through. Let’s start with two of the more basic ones just to give you an example.

git init [repository name]

The above command is init which initializes or reinitializes a new repository. Let’s see it in action! Here you’ll see my repository folder on my computer to the left and my Git Bash on the right, also in my repository folder. What do you think will happen when I hit enter on Git Bash?

Let’s see if you’re right!

If you guessed that my repo would suddenly have a new folder in it called HelloWorld, you’re correct! Upon clicking on such a new repository, it may seem as if it’s an empty folder, but that is not the case. Windows hides some more complicated files in file explorer to keep users from messing with them, but navigating within Git Bash will show you the truth: there is a .git directory with sub-directories for objects, refs/heads, refs/tags and template files. That’s pretty much the general idea of git init. Onward!

git clone [Url Here]

Hey, isn’t Github a nifty site? You can see repositories on almost anything and everything coding wise. You can open any code file and check it out in your personal IDE to fiddle with, but…That’s a little time consuming. What if you could just ‘pop’ a repository into your local repository without all that extra work? Git clone is actually what you’re looking for! For example, let’s say you wanted to clone my repository of Java code examples. Navigate into any repository on Github and you’ll see a green button to the far left that says ‘Clone or download’. Clicking that button produces a small menu with the url to the git file. Copy it and then in your GitBash you simply type:

git clone https://github.com/salkiduckyJUMP/RLHull-Repo.git

When you hit enter, you’ll see you now have a copy of the linked repository in your local repository! Try it out with the above command to get my repo.

Abstract Classes, Interfaces and How They’re Different

Hello and welcome back to this blog! Today I’m going to explain what the differences are that exist between interfaces and abstract classes. This is a topic I’m honestly still grappling with; I understand they’re different but when I try to explain it I start to get my words tied up. I’m going to definitely link to a few outside sites that explain it much better at the bottom of this blog, so if I don’t seem to be making sense at any time; maybe go take a peek at one of those and come back to finish my rambling?

Before we talk about the differences between these concepts, we should actually define them. This is actually easier said than done as the differences are what help one define them. Confused? Me too, let’s keep going! One huge common trait between the two to keep in mind is that both cannot be instantiated. So if that’s what they have in common, what’s the differences?

  • Abstract classes can have both abstract and non-abstract methods while interfaces can only have abstract methods.
  • Abstract classes can have both final and non-final variables while variables declared in an interface are by default final
  • Abstract classes allow for access modifiers while everything declared in an interface is public by default
  • Abstract classes can use constructors while interfaces cannot
  • As a general rule. interfaces tend to run slower than abstract classes
  • Abstract classes can inherit only one class while interfaces can inherit from as many as needed

There are more differences, but hopefully by now you can see the difference. Now let’s see it in action! I’ve coded essentially the same code as both an interface and an abstract class. My example is basically based around Mario Party 3 computer player behavior.

First let’s run through an abstract class code. Here is the implementation of an abstract class.

abstract class Player {
    public abstract void playerStyle();

    public void takesDamage() {
      System.out.println("Oof!");
    }

    public void victory() {
      System.out.println("I win!");
    }

    protected void score() {
      System.out.println("I can't show you!");
    }
  }

As you can see our abstract class is named Player. It has the abstract method playerStyle which has no body and three regular methods; takesDamage, victory and score. Take note: score is a protected method; this is allowed in an abstract class. Next we’ll have a couple of classes that inherit from Player.

class Mario extends Player {
    public void playerStyle() {
      System.out.println("Mario goes after Mushrooms");
    }

    public void victory() {
      System.out.println("Yahoo! Mario's the winner!");
    }
  }

  class Luigi extends Player {
    public void playerStyle() {
      System.out.println("Luigi loves Skeleton Keys");
    }

    public void victory() {
      System.out.println("Yeah! Luigi's the SuperStar!");
    }
}

In both our new classes Mario and Luigi, we’ve defined the abstract method playerStyle as well as giving victory it’s own unique response for either. Next we’ll actually use these classes in our main method to run these methods in instances of their classes.

class MyAbstractClassDemo {
    public static void main(String[] args) {
      Mario myMario = new Mario();
      myMario.playerStyle();
      myMario.takesDamage();
      myMario.victory();
      Luigi myLuigi = new Luigi();
      myLuigi.victory();
  }

Next we’ll walk through the interface version of this code. Let’s define our interface!

interface Player {
    public void playerStyle();
    public void takesDamage();
    public void victory();
  }

interface ShortLegs {
    public void superSlow();
  }

Wow! Sure looks different from the abstract class doesn’t it? Remember that all methods in an interface need to be abstract. I can’t define any of my methods in an interface. Also take note that all the methods are public; as soon as I even dared to state a method as protected here, my IDE threw me an error. Also wait–what’s that ShortLegs interface doing there, you ask? Patience! Moving right along, we’ll make our Mario and Luigi classes again!

 class Mario implements Player, ShortLegs {
    public void playerStyle() {
      System.out.println("Mario goes after mushrooms");
    }

    public void takesDamage() {
      System.out.println("Oof");
    }

    public void victory() {
        System.out.println("Yahoo! Mario's the winner!");
    }
    public void superSlow() {
      System.out.println("He's slow.");
    }  
  }

  class Luigi implements Player {
    public void playerStyle() {
      System.out.println("Luigi loves Skeleton Keys");
    }
    public void takesDamage() {
      System.out.println("Oof");
    }

    public void victory() {
        System.out.println("Yeah! Luigi's the SuperStar!");
    }
  }

Since all our methods are abstract, I needed to define all my methods in each class with their own messages. Hm, what’s that? Oh you see that ShortPlayer popping up again? Ah yes, let’s talk about that now! If you recall, classes can inherit from as many interfaces as needed. My new ShortPlayer interface only applies to one of the plumber brothers: Mario. He’s short. The Mario class here is not only getting methods from the interface Player but ShortPlayer as well. Okay, so let’s see how the main method looks with our interface and what output we get:

class MyDemo {
    public static void main(String[] args) {
      Mario myMario = new Mario();
      myMario.playerStyle();
      myMario.takesDamage();
      myMario.victory();
      myMario.superSlow();
      Luigi myLuigi = new Luigi();
      myLuigi.victory();
    }
  }

In conclusion, this has been a quick, if not nerdy, run through on the basics and differences between abstract classes and interfaces. Here are the github links for the complete code examples I used: https://github.com/salkiduckyJUMP/RLHull-Repo/blob/master/DemoAbstractClass/MyAbstractClassDemo.java and https://github.com/salkiduckyJUMP/RLHull-Repo/blob/master/DemoInterface/MyDemo.java

I’m definitely not the first one to write this kind of post and I actually used a few of them while researching this topic, so here is that promised list of links from earlier. Happy learning and happy exploring!

Let me know what you’d might want to use an abstract class or interface for in the comments; I quickly got tired of the animal sounds example that everyone and their brother seems to use.

Java Interview Questions

If you’re anything like me, you’ve walked into an interview feeling like you’re prepared. You’ve spoken confidently, you’ve made eye contact and everything seems to be going well, before you’re hit with a bombshell; a technical question. Suddenly your mind goes blank– objects? What’s an object again? You might lose all credibility in this case. This blog post is mainly a place where I’ll be updating periodically with new questions related to Java that I want to review before an interview, but you might want to review it too. Or not, it’s totally up to you; but if it helps either of us get a job, it’ll all be worth it.

Note: To see the answers, please copy the tiny text in the blue box following that specific question and paste it into your text editor of choice. Bonus: Git-related questions have their answers colored purple!

  • Name a reason you could choose to use nested/inner classes.

Essentially nested/inner classes are used to make your code more maintainable and readable.

  • Why would you make a class abstract?

Abstract class can provide some incomplete functionality or code that will be flushed out in subclasses. You can create a new subclass without editing the rest.

  • What is an interface?

Interfaces are another way to achieve abstraction, being a completely abstract class that groups related methods with empty bodies; interface that implements an interface has it’s own definition for each inherited method

  • What is a difference between abstract class and interface?

Although they are fundamentally similar, there are several differences between abstract classes and interfaces, for example:
-Abstract classes can make use of access modifiers; objects and methods declared in an interface are public by default
-Variables declared in an interface are final by default, while this is not the case for abstract classes
-Interfaces are completely concrete which means that they cannot have concrete methods which contain code; meanwhile abstract classes can have both abstract methods and concrete methods
-Abstract classes can extend(inherit from) only one class while interfaces can implement as many other interfaces as needed

  • Can you do multiple inheritance in Java? How?

Yes, by utilizing interfaces

  • How do you instantiate a scanner object to expect input from a user?

Scanner [Scanner Name] = new Scanner(system.in);

  • What kinds of streams can a scanner object accept?

Any, including files!

  • Can you subtract dates from each other using the Date package?

Not implicitly, but there are a few methods in the Date package that can be used to achieve this.

  • Why are Java wrapper classes immutable?

They create a new object instead of updating the old.

  • What does the File class represent in your PC?

The File class can be considered to be an abstract representation of your PC’s file explorer. You can navigate and manipulate files using the File class, just as you can do in File Explorer for example.

  • What are the contents of a Git config file?

git config is the command you use in Git to set your name and e-mail address to be noted each time you commit to a project; the contents of a git config is this name and e-mail address.

  • Does creating a repository with git init give you an empty folder?

No, repositories created by entering git init give you a .git directory with sub-directories that include objects, refs/heads, refs/tags and template files.

  • What does git rm do?

git rm can be used to remove files/repositories from your working directory and stages the deletion for your commit/push.

  • Why would we use git log?

git log lists the version history for the current branch when it is called. This is extremely useful, for example, if you’re attempting to find a previous version when a certain feature was added in your code that messes with another part of your code. Knowing which version it was automatically by calling git lot without needing to dig yourself to get a list of every version is greatly efficient.

  • How do you check hierarchy of a tag?

git show [tag name here]^{tree}

  • Why would you use tags?

Say it with me; versioning! Tags can help you quickly locate different commits and versions.

  • If we have three items in git stash, and we don’t specify index number which one will it affect?

The most recently added item; git stash is a FILO system(First-in-last-out).

  • What is a static variable?

A static variable is a variable which belongs to the class; this means that any object of the class can access it.

  • Is there a command to list the branches that are merged in Git?

git branch –merge
git branch (without the –merge) will also list all branches, merged and non-merged!

  • Importance of git branch/git checkout?

It is best practice to avoid updating the master branch while you are collaborating on a project with several teammates using git. These commands help you by making sure you only update a certain branch(copy) of the project and later you can merge your changes with the master. It helps to avoid version conflicts and general confusion as well!

  • Difference between class method and instance method.

Class method is a method defined within a class, it belongs to the class—instance method is used inside of an instantiated object, it belongs to that object.

  • Why would you want to use inheritance?

The main selling point of inheritance is that it promotes re-usability!

  • What is a proper use for comments?

A comment can be mainly used to give a brief description of what your code is doing; this is useful not only for your future reference( “what was I coding again?” ) but for anyone who reads your code.

  • Is an object a reference?

Yes, it points to a location in memory where the data is actually stored.

  • True or False: Implicit type casting will most likely make you lose data.

False; implicit is when you go from smaller data types to larger; the larger data type can handle the data easily from the smaller. Reversely, explicit type casing, going from larger data types to smaller is where you can lose data because a byte can handle only a fraction of the range of an int, etc.

  • What does system.in do?

Tells the program to expect user input from the keyboard

  • Why do you use ‘new’?

New tells the program that you’re declaring a new object in your class.

  • What is the purpose of a constructor?

The purpose of a constructor is to initialize an object in a class, noticeably different from methods which perform some task when called.

  • What’s the difference between = and ==?

A single = is an assignment operator, used to give a value to a variable. == is used to check if a value is equal to another value.

  • What happens if there are no break statements in a switch?

If there are no break statements in a switch, the switch will output the last case regardless of argument.

  • What if your while loop can’t reach the limit you set in your counter?

If your limit loop is unreachable (if it skips over for example), the loop will just continue iterating until you manually stop it or your computer crashes from reaching the limit. It’s extremely important to set a reachable end in your while loop!

  • Are you able to skip elements in an array?

No, you must iterate through every element in an array.

  • What is the purpose of the finalize() method? Why should we avoid using it?

finalize() is a method of java.lang.Object. It can be overridden to close object operations in memory before the object is removed and clean up resources. While it might sound like a nifty time-saving method, it’s unreliable based on when it runs or if it even runs. If you rely on it to free up resources in your code, you might run out of those resources while compiling.

  • What is a singleton?

A singleton is a design pattern where a class has only one object, which is an instance of the class itself.

  • Describe what the JRE is.

  • Describe what the JDK is.
  • Describe what the JVM is.

Polymorphism in Java

I have a confession: I’ve always been a bit rusty with the four basic rules of object oriented programming. These being abstraction, encapsulation, inheritance and today’s victim topic, polymorphism. I’m happy to say I now have a better understanding of this subject and hopefully I’ll be able to help you out too!

Let’s get that big word that my spell correct seems to think is wrong to be less scary. Polymorphism basically means “many forms” and it occurs almost directly as a result of inheritance. As a recap or general introduction, inheritance is an aspect that allows subclasses to inherit methods/attributes of classes.

Polymorphism in turn allows us to perform a single action in different ways by using these inherited methods. Let’s look at a quick example!

To begin with, we create a class and a few subclasses which inherit a method from their parent class. Here we have a House class with a door. All houses have doors, but not necessarily the same kind of door, so each of the subclasses have a different response for the door method.

    class House {
        public void houseDoor() {
          System.out.println("The house has a door");
        }
    }

    //TownHouse inherits methods/attributes from House
    class TownHouse extends House {
        public void houseDoor() {
          //Different for each type of house, despite being the same method
          System.out.println("The town house has a sliding glass door");
        }
      }
    
      class FarmHouse extends House {
        public void houseDoor() {
          System.out.println("The farmhouse has a dutch door");
        }
      }

      class SafeHouse extends House {
          public void houseDoor() {
            System.out.println("The safe house has a concrete door");
          }
      }

If I wanted to call on these classes, I need to create a new instance of each of these classes. This code simply prints the following output to the command-line, representing the different kinds of doors for each type of house.

 class MainClass {
        public static void main(String[] args) {
            //Create a new instance of each of my classes
                House myHouse = new House();
                House myTownHouse = new TownHouse();
                House myFarmHouse = new FarmHouse();
                House mySafeHouse = new SafeHouse();

                //Call on the method houseDoor from each of these new instances
                myHouse.houseDoor();
                myTownHouse.houseDoor();
                myFarmHouse.houseDoor();
                mySafeHouse.houseDoor();
            }
        }

For the full code that was featured in this blog, you can visit my git at: https://github.com/salkiduckyJUMP/RLHull-Repo/blob/master/Polymorphism.java

Bonus fact: this blog actually has an example of only one kind of polymorphism in Java! The houseDoor code above is method overriding, but you can also have method overloading. I won’t go into detail, but you can visit this link to learn more on the differences between this and the other type of polymorphism; https://www.geeksforgeeks.org/polymorphism-in-java/.

Data Types in Java

Hello everyone! Today I wanted to explain the concept of the various data types in Java.

To start with, you need to understand that there are two kinds of data types; primitive and non-primitive. The main difference between the two is that non-primitive types are predefined by Java for us; it’s the main reason we are focusing on the primitive types, as we’ll be defining and creating them! The other important thing to remember about the primitive data types are they’re the more ‘traditional’ idea behind the term “data type”. We use these to store and manipulate data and they are pretty basic in nature.

There are eight primitive data types offered in Java that I like to think of as belonging to three categories. Remember as we’re going through the examples that you must declare a data type before you use it with it’s type and name!

First we have the numeric data types which are differentiated from by the size of the data being stored. A byte is best to store a very small number, anywhere between -128 to 127, or 8-bits.

byte myByte = 50;

A short is best to store a larger number, anywhere between -32,768 to 32,767, or 16-bits.

short myShort = 22445;

An int is the most common numeric data type you’ll see and use. It is equivelent to 32-bits, so it can store a number between negative two-billion and two billion.

int myInt = 500000;

A long is the last and largest numeric data type. Coincidentally, it goes to a 64-bit limit and it’s very likely you’ll never need anything more for your number-storing needs. This is because it can store anywhere between negative nine-quintillion and nine-quintillion. The long data type does not mess around!

//NOTE: When defining a long, you must enter an L at the end
long myLong = 873499849546656L;

The next category concerns fractional numbers. Once again, the major difference between these two data types is the number of decimal digits you need to store.

First, we have a float which can only handle between six or seven digits. Float also has to be a special flower like long in which you need to add a letter at the end in order for it to act correctly.

//NOTE: add the f at the end!
float myFloat = 86.75309f;

Next up is the more common fractional number data type, you might as well call it int’s brother from another mother; the double! Doubles can handle up to fifteen decimal digits, making it much more suitable for precise calculations.

double myDecimal = 65.545454545454;

I’ll be honest with you; the last category is more of a hodgepodge, they don’t have a whole lot in common with each other.

First we have boolean, which can store two different values; either true or false. It’s useful for checking other data types against each other and performing if/else statements, etc.

boolean checkSize = false;
int first = 5;
int second = 9;
        if (second < first) {
        } else {
            System.out.println(checkSize);
        }

Next we have the char data type, useful for storing a single character.

char myCharacter = 'y';

So….We’re done now right? Eight data types, I gave you eight examples, you should go home now right? WRONG! Surprise, we’ve got one left to talk about! The String data type. It’s what’s normally referred to as the ‘ninth’ data type, but it’s special in the fact that it’s non-primitive. Java defines string for us, we just need to declare it. A String can hold a sequence of characters such as movie titles or commands.

String myString = "Back to the Future";

Okay, now you can start gathering your stuff and getting out of here. I gave you a quick crash course in Java data types and hopefully it was interesting for you! If you wish to see more of the code snippets that you saw here please go to my git post at: https://github.com/salkiduckyJUMP/RLHull-Repo/blob/master/JavaDataTypes.java