Linked List in Java 2

Linked List in Java 2In my previous Linked List in Java tutorial, I showed you how to create Linked Lists and how to manipulate them.

In this tutorial, I will cover Double Ended Linked Lists which have a reference to the first and last link. I cover how a Doubly Linked List allows you to go backwards and forwards in a list. Then we take a look at Iterators.

Numerous other topics are covered and the code and video below will help you learn. Continue reading Linked List in Java 2

Linked List in Java

linked list in javaIn this video, I’ll cover how work with a linked list in java. I’ll show you how they work in 4 different ways.

We’ll cover how to create them, what a link is, how to add and delete links, how to search through them and a whole bunch more. The basics you need to understand at the end are that: 1) A Link is an Object 2) Each Link has a reference to another Link in the List 3) The LinkedList has only a reference to the last Link added to it. Continue reading Linked List in Java

Stacks and Queues

Stacks and QueuesWelcome to my tutorial on Java Stacks and Queues. The data structures most are used to such as Arrays, linked lists, trees, etc. are best for data that represents real objects. Stacks and Queues are instead used to complete a task and are soon after discarded.

A major difference is that stacks and queues allow only a single item to be added or removed at a time. Stacks then provide access to the last item in, while queues provide access to the first item in. The video and code below will cover everything. Continue reading Stacks and Queues

Java Sort Algorithm

java sort algorithmWelcome to my Java sort algorithm tutorial. Here I will cover all of the elementary sorting algorithms : Bubble, Selection and Insertion sort.

I also created a new method we can use to analyze the arrays so we can learn how the sorts work. I want this video to be very interactive so that you really understand the sort algorithms.

I also cover the linear and binary search algorithms. The code below will help you learn these algorithms perfectly. Continue reading Java Sort Algorithm

Java Algorithms

Java AlgorithmsWelcome to my Java Algorithms tutorial. In this series I will cover everything there is to know about Java algorithms and data structures.

An algorithm is just the steps you take to manipulate data. A data structure is the way data is arranged in memory. There are 3 main data structure operations I will focus on first being inserting, deleting and searching for data.

Like all of my tutorials, everything is simple at first and then I cover more complex topics. The code below should help. Continue reading Java Algorithms

MVC Java Tutorial

MVC Java TutorialWelcome to my MVC Java Tutorial. I have been asked for this tutorial many times in the last few weeks.

To understand the Model View Controller you just need to know that it separates the Calculations and Data from the interface. The Model is the class that contains the data and the methods needed to use the data. The View is the interface. The Controller coordinates interactions between the Model and View.

The video and code below will make it very easy to understand. Continue reading MVC Java Tutorial

Mark of the Ninja Review

Mark of the Ninja ReviewThe other day I was told it was impossible to make a great 2D scrolling platformer game. While I could name numerous great ones, I figured I’d do a review on one of my recent favorites that many people haven’t heard of. So today I present my Mark of the Ninja Review!

I by no means plan on making many video game reviews (It is surprisingly hard), but I wanted to try and make one today just to see how it would turn out. I hope you think it is fun 🙂 Continue reading Mark of the Ninja Review

Refactoring Video Tutorial

Code Refactoring Video TutorialAfter you learn the core syntax of a language many programmers are lost on what to learn next. What do you need to know to create large flexible and extendable applications?

I did my best to teach you how to structure your programs in my Object Oriented Design Tutorial. And, to understand OOD you have to understand UML. Then we walked down the path laid by the programming masters when we looked at Design Patterns. That left me with the final part of writing great code, which is my refactoring video tutorial. Continue reading Refactoring Video Tutorial

Code Refactoring 18

Abstract Factory PatternIn this tutorial I end my Code Refactoring Tutorial. It was a big one and between it and my Design Patterns Video Tutorial you should be able to do most anything.

To end this tutorial, I’ll cover the Abstract Factory Pattern again to make sure you understand it. It is often considered a hard to understand pattern, but I’m sure you’ll get it after this video. The code that follows will help explain anything you miss in the video. Continue reading Code Refactoring 18

Code Refactoring 17

Visitor Design PatternIn this part of the code refactoring tutorial I will answer another challenge I recently received. This tutorial is all about the Visitor Design Pattern.

You use the visitor design pattern when you want to perform a similar calculation on many different objects. It seems to confuse people, but I hope to solve that here. If you understand the concept of method overloading and the passing of objects back and forth for data access I don’t think you’ll have a problem. The code that follows should answer any questions you have. Continue reading Code Refactoring 17

Code Refactoring 16

Replace Embellishment to DecoratorIn this tutorial, I’ll answer a question that was sent to me. The question pertains to how can we add additional features to code the right way.

When new features are needed it is a bad idea to add new code to older classes. This makes compact easy to understand classes complicated because they break the Single responsibility principle. I’ll show you here how the decorator design pattern instead places each special case behavior (Embellishment) into its own class.

This is a fabulous pattern. The code below will help you learn from the video. Continue reading Code Refactoring 16

Code Refactoring 15

Replace Primitive Type with a ClassIn this part of my code refactoring tutorial, we’ll look at how to replace a primitive type with a class.

Type safety is very important! So, what we want to do is to eliminate all operations on values that are not of the appropriate data type by protecting the program from bad input. One way we can do this is by replacing primitive types with classes. I’ll walk you step-by-step through the process. The code below will help you along. Continue reading Code Refactoring 15

Use a PS3 Controller with a PC

Best Mac Game ControllerToday I’m going to show you how to use a PS3 controller with a PC. I’ve received this question many times. Most of the problems come from the fact that people don’t know how to find MotionInJoy. You don’t have to worry about that now, because you can download MotionInJoy here.

Now that you have the MotionInJoy zipped file, we can set everything up. It is extremely easy to do. This also works for Mac users who want to use a PS3 controller with Parallels. Continue reading Use a PS3 Controller with a PC

Code Refactoring 14

Code Refactoring Adapter PatternIn this part of the code refactoring tutorial, I’ll show you how and when to use the Adapter Design Pattern.

With the adapter pattern we can create a new class without disturbing any other code. On top of that adapters make it easier to swap in code at runtime. They also allow you to communicate with code using method names that make sense to you.

I refactor code sent in by one of you and show you how to add a ton of flexibility. The code is below to help you learn. Continue reading Code Refactoring 14

Code Refactoring 13

Replace Conditional with CommandIn this part of my code refactoring tutorial, I’ll show you how to replace conditionals with the command pattern. I’m also going to do more though.

I’ll also review what the command pattern is. I’ll give an example of when you should use it. We’ll look at how to add flexibility with it. I’ll answer your questions based on the refactoring to patterns book. And, we’ll look at how to store commands in an ArrayList. If you need more look at my Command Design Pattern Tutorial and the code below. Continue reading Code Refactoring 13

Code Refactoring 12

Move Accumulation to Collecting ParameterIn this code refactoring tutorial, I’ll show you how to eliminate large Accumulation Methods by Extracting Methods and Using a Collecting Parameter. It sounds complicated but it isn’t!

This tutorial will show you another way to make your code more readable. It will also introduce you to a few jargon terms you will need to know for the future. This video is shorter than normal to focus on topics you need to understand. The code below will help you master this topic.

Continue reading Code Refactoring 12

Code Refactoring 11

Code Refactoring 11One of you guys sent me a request to explain the chapter in Refactoring to Patterns titled Encapsulate Composite with Builder. We will build a table structure (composite) using the Builder design pattern.

I’ll expand the capabilities of the code from this great book to allow us to more easily traverse the tree structure. This will allow us to add children, siblings and item information using a HashMap. This is a beautiful refactoring. All of the code can be found below to help you learn it. Continue reading Code Refactoring 11

Free Video Games

Free Video GamesThe other day I didn’t have time to make a video tutorial, but I wanted to upload something. A great game I recently started playing called Don’t Starve lead to a video you guys seemed to like. (I Gave 1 Copy Away for Free)

I really like games and I’d love to give you guys something. That made me wonder if you’d like me to give away a game at random every week? I’ll still make just as many video tutorials, but I thought this might be fun to add on as an extra video every week. You tell me what I should do in the vote below.

Continue reading Free Video Games

Don’t Starve The Game

Don't Starve Game WalkthroughBecause you guys seem to love games I thought I’d Don’t Starve game walkthrough. This game shows you just how great a 2D game should be. When I start making games, I’m definitely making a game similar to this.

So often beginning developers try to make Atari type or first person shooter games. This is a great example of an easy to design game that has amazing depth. There is so much to learn about game development by just playing this game. I hope you enjoy it. Continue reading Don’t Starve The Game

Code Refactoring 10

Builder Design PatternIn this part of the code refactoring tutorial I’m going to revisit the Builder Design Pattern for a couple of reasons. First, I receive a bunch of questions about it. Secondly, in the next tutorial I’ll show you how to build composites, which were covered in the last part of the code refactoring tutorial, with the builder pattern.

The builder pattern allows you to build complex objects in a series of steps. In the video and code below, we will build sandwiches. Here is he previous tutorial on the Builder Design Pattern to help as well. Continue reading Code Refactoring 10