Abstract Software Class Method

From GM-RKB
Revision as of 06:47, 7 January 2023 by Gmelli (talk | contribs) (Text replacement - "xam ple" to "xample")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

An Abstract Software Class Method is an Object-Oriented Class Method that ...



References

2014

  • (Wikipedia, 2014) ⇒ http://en.wikipedia.org/wiki/method_(computer_programming)#Abstract_methods Retrieved:2014-8-9.
    • An abstract method is one with only a signature and no implementation body. It is often used to specify that a subclass must provide an implementation of the method. Abstract methods are used to specify interfaces in some computer languages.

      … The following Java code shows an abstract class that needs to be extended:
      abstract class Main {
      abstract int rectangle(int h, int w); // abstract method signature
      }

      The following subclass extends the main class:

      public class Main2 extends Main {
      @Override
      int rectangle(int h, int w)
      {

      return h * w;
      }

      }