 Now, here's where things differ a little bit as well when it comes to interfaces. When I want to use an interface, when I want my class to inherit from an interface, I actually do not say extends. I actually state something known as implements. Here's where things start to differ. Extends. Extends, obviously, is my abstract class. I am only allowed one, I'm only allowed one superclass, so mammal. I can't have feline as well, I can only extend one class. However, I'm able to implement any number of interfaces. We can think about that again as that idea of a blueprint. If we think about cats for a second, we have domestic cats and then we also have feral cats. Instead of just having them being pets, we could also implement, and how we would do that is we would implement this thing, feral or something along the lines, predator, outdoorsy pet. That's how I would go about doing this is by stating implements. Now, again, because cat is an actual class, it's not an abstract class, I have to implement from it. Because I extend from mammal, I inherit makesound and I inherit sleep. Because I implement pet, I also inherit pet and I inherit train. Now, I just threw on a little array list here, that way I could throw some tricks in there, but you can see this is how I start to operate. Now, again, I said that I can implement any number of interfaces. Why would I want to do that? Now, pet, feral, okay, those are all right, but some of the other ones that we can do are some of the ones that are pre-built already for us in Java. Think of it this way. The same way that we know that there is a date class, date d equals new date that we can just magically do. The same thing with random, I can just magically do these things and we don't think none the wiser to it, random. The same thing happens with interfaces. Again, an interface is more of a quality that I'm saying. Some of those ideas can be something known as the comparable interface. The comparable interface does exactly what it sounds like. First it gives me the compare to method. You're going to notice that I got this little e here. You have to specify this. If I was to compare cats, I would come in here and I would say public class cat extends mammal implements and I'm going to run out of room implements pet comma and I'll come down here for comma comparable just like we did with the array list. We have to say what it compares to. Now in this case, we're dealing with a cat. I want to make my cat comparable to other cats. Again, I now have this compare to method that I can look at and I can say anything I want. Is my cat better than your cat? Is my cat older than your cat? Whatever means that I want to specify as the compare to algorithm. How it should operate since it is a return type of int, how compare to works is it's basically expecting. This is something pre-built by Java so it's expecting negative one if it's less than, zero if it's equal to, and one if it's greater than. This will become very beneficial in a second but instead of cats, let's just use something that has a physical idea to it. Something like date. Again, we've talked about the date class just a second ago but if I'm looking at something like a date, well I've got 2014 and 2013. Which one is greater than? What will happen is it will look at this and it will say that, oh well, this day happened before this day so this is going to be less than. What this is going to then produce is negative one. Why would I want to do this? Again that negative one, that's going to be beneficial because if you remember you might have seen this kind of thing, something called java.utils.arrays.sort and that normally will take an array of something, it doesn't know what and it will sort it. Now we got lucky we were using integers or primitive data types when we were working on it in the past when we learned about the arrays.sort technique but what about our now complex data types? We're talking about again dates here so how would I do this? Well guess what? If I have been to have a bunch of complex data types and I want to use something like sort it will automatically go in and do the compare to and say well in this case more cities, Wilmington that's a W, well compared to surf city, surf city comes before Wilmington, Wilmington in this case it would do the compare to, compare to Wilmington, surf city this is going to produce a positive one because Wilmington should come after surf city and then java because java has this going on in the background is going to sort of build that up it's going to swap these around as necessary until finally it is properly sorted at which point when I run through this print statement what I will see is Castle Hane, Hampstead, Ogden, Surf City, Wilmington.