In our upcoming module, we are going to be working with something called an interface. It's a good time to actually discuss interfaces. In Java, we know about inheritance. One class can inherit from another. Meaning the inheriting class has all of the methods and properties of the class from which it's inheriting, plus it can have its own. In this case we can see Calc extends JFrame. The extends keyword indicates inheritance. We know that Calc has all of the methods and properties of JFrame plus we can add it. Well, we can add Calc's own methods and properties here, but this class can also implement an interface. When we see implements keyword, a class extends or inherits from another class. But a class can also implement an interface. What is an interface? An interface is considered to be an abstract structure. A Java class can comply with this abstract structure, but it specifies behavior. So an interface is really a list of method headers that define how a class will behave. Let's take a look here. We are creating a new interface and we're going to call it a Bicycle, and Bicycle has these two methods, right? Well, you can see right here has the data and these two methods. Here's how the methods behave. They do not return any data, and they both pick integers. Here are the names of the methods. Every class that implements this interface must have these data and these methods in here, just as we see them implemented by these headers here, notice there's no code blocks here at all because this is an interface. This is not a class. They're not really empty methods. They are the method headers. Again, this will enforce or force all classes to implement the same type of behavior. When we implement though, the code in these methods can be whatever the needs of the application are. We're not required to add any specific code in here with these methods. It's more done on the class level of what the methods actually take and what is returned. Tools can help us automate the implementation of interfaces in classes. If we just take a look here, use our Eclipse, New Class, we'll name the class "MountainBike", and we click "Add" and we searched for the interface Bicycle. When we click "Finish", you can see here that MountainBike class, MountainBike was created implementing bicycle and it gave us for free here, these two methods. It gave us the change gear, taking the integer that we see here. It also gave us the break, taking the integer that we see here and we get the curly braces. Now they are a true methods there, empty. We can add whatever we need for this application, so whatever MountainBike needs, we can add there. There's no requirement as far as the code and the methods, but we need to have the methods as they were specified in interface bicycle. That's what we have here. If we didn't, if we took away one of these methods, we would get an error saying that the class is not compliant with the abstract. As we can see here, as we continue to work on this class, we are adding whatever we need to these methods that are being inherited from Bicycle. We see here, we added some data. Then down here in the main method we are instantiating MountainBike creating object MB. Then we're calling change gear and break passing in integers. Notice they're not returning anything right down here in the main method. Let's take a look at a quick demo of just an example of what we'll be doing in the upcoming labs. Here we have a class, no errors right now and is just the beginning of a class, and with this class we are going to inherit from JFrame, so let's put in here, extends JFrame, which is a swing component. That's fine. No errors yet. But we're also going to implement an interface called ActionListener. Let's implements. Then suddenly we have an error here, and if we hover over here, we can see that, the last line there says that our class must implement the inherited abstract method. In this case, it's action performed, so in ActionListener, we need a method called action performed, which you can add right now. We edit it here and now the error has gone away. We can see here that if we're going to implement ActionListener, we need at least this method in here. As we go through the labs, we'll be adding our own code as needed to action performed. We're not required by Java to have this method of function in any particular way. Let's continue, and so this was just a brief review and introduction of the abstract structure interface.