Abstract type: Difference between revisions

Line 1,422:
 
=={{header|Java}}==
Java has an ''interface'' and an ''abstract class''. Neither of which can be instantiated, and require some sort of implementation or abstraction.<br />
For an ''interface'', only the ''private'' and ''default'' access modifiers are allowed, which also implies they require code.<br />
A ''private'' method cannot be overridden by a sub-class, and a ''default'' method, optionally, can.<br />
Line 1,478:
Here is an example of a class which ''extends'' an ''abstract class''.
<syntaxhighlight lang="java">
public class ExampleImpl extends Example {
public int methodC(int valueA, int valueB) {
return valueA + valueB;
118

edits