Method (computer programming): Difference between revisions

Content deleted Content added
Undid revision 802625697 by 103.50.145.83 (talk)
YoYoYonnY (talk | contribs)
m Changed example to be more realistic and changed it's style to reflect Google's Java Style Guide.
Line 70:
 
<syntaxhighlight lang="java">
abstract class MainShape {
abstract int rectanglearea(int h, int w); // abstract method signature
}
</syntaxhighlight>
Line 77:
 
<syntaxhighlight lang="java">
public class Main2Rectangle extends MainShape {
@Override
int rectanglearea(int h, int w) {
{
return h * w;
}
}
</syntaxhighlight>