cs notebook0
  • Introduction
  • Core Java
  • some notes
  • Data structure&algorithm
  • Garbage Collection
  • HashMap
  • Collection0
  • Collection1
  • Collection2
  • comparatorVScomparable
  • exception0
  • exception1
  • exception2
  • Enum in Java
  • JVM
  • Wrapper Classes in Java
  • String, int convert
  • HashSetVSTreeSetVSLinkedHashSet
  • Pair
Powered by GitBook
On this page
  • 1.
  • import java.util.EventListener;
  • 2 type signature
  • 3.method signature
  • 4. Built-in Class
  • 7. typeless language VS type language
  • 8. functional programming language

Was this helpful?

some notes

PreviousCore JavaNextData structure&algorithm

Last updated 5 years ago

Was this helpful?

1.

import java.util.EventListener;

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.

2 type signature

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.

3.method signature

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.

4. Built-in Class

These classes are not really part of the language; they are provide in the package java.lang.

eg:

String, Object, Boolean, Integer, Double, etc

7. typeless language VS type language

8. functional programming language

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.

computer science
function
subroutine
method
Java programming language