samples/individualsamples/src/org/apidesign/samples/SuperInner.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 29 Oct 2011 20:43:05 +0200
changeset 386 5cb249d26583
permissions -rw-r--r--
SuperInner examples
jtulach@386
     1
package org.apidesign.samples;
jtulach@386
     2
jtulach@386
     3
/** Sample code for http://wiki.apidesign.org/wiki/SuperVsInner essay */
jtulach@386
     4
public class SuperInner {
jtulach@386
     5
    // BEGIN: superinner.java
jtulach@386
     6
    public abstract class JavaLikeExample {
jtulach@386
     7
      public final int callable() {
jtulach@386
     8
        return 1 + theSlot();
jtulach@386
     9
      }
jtulach@386
    10
jtulach@386
    11
      protected abstract int theSlot();
jtulach@386
    12
    }
jtulach@386
    13
    // END: superinner.java
jtulach@386
    14
jtulach@386
    15
    /*
jtulach@386
    16
    // BEGIN: superinner.beta
jtulach@386
    17
    public abstract class BetaLikeExample {
jtulach@386
    18
      pubment int callable() {
jtulach@386
    19
        int res = inner.callable();
jtulach@386
    20
        return res + 1;
jtulach@386
    21
      }
jtulach@386
    22
    }
jtulach@386
    23
    // END: superinner.beta
jtulach@386
    24
     */
jtulach@386
    25
    
jtulach@386
    26
}