some notes
Last updated
Was this helpful?
Last updated
Was this helpful?
public interface ActionLister extends EventListener{
public void actionPerformed(ActionEvent e);
}
The ActionListener example is an interface with only one method. With Java SE 8, an interface that follows this pattern is known as a "functional interface". Note: This type of interface, was previously known as a Single Abstract Method type(SAM).
Using functional interfaces with anonymous inner classes are a common pattern in Java. In addition to the EventListener classes, interfaces like Runnable and Comparator are used in a similar manner.
In , a type signature or type annotation defines the inputs and outputs for a , or . A type signature includes the number of arguments, the types of arguments and the order of the arguments contained by a function. A type signature is typically used during overload resolution for choosing the correct definition of a function to be called among many overloaded forms.
In the , a method signature is the method name and the number and type of its parameters. Return types and thrown exceptions are not considered to be a part of the method signature.
These classes are not really part of the language; they are provide in the package java.lang.
eg:
String, Object, Boolean, Integer, Double, etc
C++, JavaScript are called functional programming language because we can write functions and use them when required. Some of these languages support Object Oriented Programming as well as Functional programming.