What type of exception is a ClassCastException and when does it occur?
A ClassCastException is a Runtime Exception and it occurs when an object cast into another object that the object isn't.
What are the four types of I/O?
Reader and Writer and InputStream and OutputStream.
What is the function that needs to be implemented when working with Threads and what is the function that is called to make the Threads work concurrently?
Run
Start
What is a network?
The term for the software and hardware that allows computers to communicate.
True or False: GUI's run on the same thread as the main thread?
False
What is the difference between a Runtime Exception and a Checked Exception?
A runtime exception doesn't have to be caught or thrown explicitly in the syntax and is an Unchecked Exception.
What is a decorator pattern?
When an object takes in another object to expand its functionality.
What are the two ways to make a Thread in Java?
Extending Thread and implementing Runnable.
What is a ServerSocket and what parameters are needed to make one?
The ServerSocket opens a network on the provided port which other sockets can connect to.
What method is used to run the GUI and what order of methods are called after that?
Application.launch(args);
init, start, close
What is the syntax to throw an Exception with the message "sup".

Write the line of code to create a PrintWriter to System.out. If you can also make it so the PrintWriter auto flushes when it encounters a new line then you get double points.
PrintWriter pw = new PrintWriter(System.out, true);
What is it called when two threads are stuck waiting for the other one wake it up?
Deadlock
How does a server connect to a client? Not just the method but also how the method works.
The server calls the accept() method. This then causes the thread to wait until a Socket connects.
Which methods do you call to set the elements of a BorderPane?
setTop, setLeft, setCenter, setRight, setBottom
What is the difference between an Error and an Exception?
An Error shouldn't normally be handled. They can be handled just like Exceptions, except they probably shouldn't because it is very difficult to recover from and it isn't a hundred percent sure when they occur.
What happens when wait and notify is not called in a synchronized block of code? What exception can be thrown when wait() is called?
IllegalStateMonitorException
InterruptedException
What is the difference between TCP and UDP?
TCP - Guarantees data is sent and received and is slower
UDP - Is faster but data might not reach and might not reach in the same order they are sent
Write the code that when a button is clicked then the function runButton is called.
button.setOnAction(e -> {
runButton();
});

What is the output of this function?

Why did you learn IO and exceptions in the same week?
IOExceptions are often thrown when working with IO and IOExceptions are Checked Exceptions. It is impossible to learn IO without first learning Checked Exceptions.
What is synchronized?
synchronized is the keyword to allow only one thread into the section of the synchronized code.
Write code that connects to a server with the hostname: "localhost" and the port number 25565 and then creates the BufferedReader and PrintWriter to talk to the connected socket.
Socket client = new Socket("localhost", 25565);
BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
PrintWriter writer = new PrintWriter(client.getOutputStream(), true);
Which tier usually creates the model tier and why?
The View Tier, because it needs to add itself as an Observer.