class Demo { // An abstract class may include abstract methods, which have no implementation. abstract public int sum(int x, int y); // An abstract class may also include concrete methods. public int product(int x, int y) { return x*y; } } //By default, all methods in all interfaces are abstract, unless the default keyword is used. interface DemoInterface { [abstract] int getLength(); //Abstract can be used here, though is completely useless //The default keyword can be used in this context to specify a concrete method in an interface default int product(int x, int y) { return x * y; } } Use of abstract types Abstract types are an important feature in statically typed OOP languages. Many dynamically typed languages have no equivalent feature (although the use of duck typing makes abstract types unnecessary); however traits are found in some modern dynamically-typed languages. Some authors argue that classes should be leaf classes (have no subtypes), or else be abstract. Abstract types are useful in that they can be used to define and enforce a protocol; a set of operations that all objects implementing the protocol must support. Abstract types are also an essential part of the Template Method Pattern. See also Class Concept Type class References Further reading Core Java: An Integrated Approach by R. Nageswara Rao External links "Abstract or Skeletal Interfaces Explained" Types and Programming Languages by Benjamin Pierce (MIT Press 2002) Abstract type at Rosetta Code Type theory Articles with example Java code sv:Klass (programmering)#Abstrakt klass