Java syntax: Difference between revisions

Content deleted Content added
last->latest, main() -> main(String[] args)
do() -> doSomething(), methods -> method
Line 1,164:
<source lang=Java5>
class Operation {
public int dodoSomething() {
return 0;
}
Line 1,171:
class NewOperation extends Operation {
@Override
public int dodoSomething() {
return 1;
}
Line 1,370:
</source>
 
Annotations may have the same declarations in the body as the common interfaces, in addition they are allowed to include enums and annotations. The main difference is that abstract methodsmethod declarations must not have any parameters or throw any exceptions. Also they may have a default value, which is declared using the <code>default</code> keyword after the method name:
 
<source lang=Java5>