This course is accompanied by exercise files that you can use to follow along with the demonstrations on screen. Copy the exercise files to your desktop for easy access, or you can place them anywhere.
- [Instructor] This course is accompanied by exercise files that you can use to follow along with the demonstrations on screen. I've copied the exercise files to my desktop for easy access, but you can place them anywhere. Now I want to show you how the files and folders are set up for this course. I'll start by opening up the exercise files, and I'm going to open up chapter 01. Then 01.01. There's a folder for each movie that contains an exercise file. Inside the folder that corresponds with the movie, I'm including a copy of the file that you see at the beginning of the lesson, in this case, ComparableExample.Java.
In addition there is a folder labeled Final. This is the finished file for each activity that I use in the course. That way you can add the starting template file to your IDE project folder, your Integrated Development Environment project folder, or open it in a Text Editor if you're not using an IDE and follow along. The finished file is included as a reference in case you can't follow along but want a copy of the final version of the file. To help you get started, I'm going to walk through the process to add a file to a project in Netbeans.
The most important thing to remember is the project file naming standards. In Java, the file name must match the class name inside the file. So here in the folder Ch01, 01.01 you'll see I have a file name, ComparableExample.java, so I'm going to go to my IDE and create a project with the same name. This is going to make my life a lot easier 'cause now I can just copy and paste the code. So I'm going to do File, New Project, Java Application, ComparableExample.
Then I'm going to click Finish. Now I'm going to go back over to my Exercise Files folder and I'm going to go back to the Template file. I'm going to open this up in a Text Editor. I can use the shortcut key, CTRL A, to select everything, and then CTRL C to copy. I'm going to go back over to Netbeans and I'm going to do the same thing. I'm going to do CTRL A to select everything inside the file, and then CTRL V to paste. Okay, there is my file.
I'm going to hit Save and now I'm ready to go and follow along with the code. I do want to point out that these files are all just a convenience. They are not required. They just might make things a little easier when you're following along.
- Defining generics in Java
- Reviewing the syntax of generic classes, interfaces, and methods
- Reviewing type erasure
- Working with generic classes, methods, and interfaces in Java
- Working with bounded generic types