Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You <strong>can't</strong> use <code>super</code> to call a method of <code>Navigation</code> from inside <code>EdumateSuperClass</code>.</p> <p><code>EdumateSuperClass</code> is the superclass of <code>Navigation</code>.</p> <p>Your hierarchy is: <code>ScriptSuperClass</code> -> <code>EdumateSuperClass</code> -> <code>Navigation</code>, where -> indicates "base class of" or "super class of".</p> <p><code>Navigation</code> can use <code>super.X()</code> to call <em>concrete</em> methods of <code>EdumateSuperClass</code>, <strong>not</strong> vice versa.</p> <p><br/> When you're doing <code>super.clickNewButton()</code> from inside <code>EdumateSuperClass</code>, it's trying to call the method <code>clickNewButton</code> from inside of the base class <code>ScriptSuperClass</code>. This method is <em>undefined</em> for the class <code>ScriptSuperClass</code> and therefore that is why you get that specific error.</p> <p><br/> <strong>EDIT:</strong> If you wanted, you could have <code>EdumateSuperClass</code> remain an abstract class which declares an abstract method <code>abstractMethod()</code> and <code>Navigation</code> be a concrete class that defines a concrete implementation of this method.</p> <p>You still <strong>can't</strong> use <code>super</code> from <code>EdumateSuperClass</code> to call this method inside <code>Navigation</code>, however this will allow you to use <code>EdumateSuperClass</code> as basically an interface when grouping objects.</p> <p>ie. You could have an array of <code>EdumateSuperClass</code>, which means that this array can hold references of <em>concrete</em> class objects derived/extended from <code>EdumateSuperClass</code>. For these classes to be <em>concrete</em> they <em>must</em> define <code>abstractMethod()</code>. From there you can store <code>Navigation</code> objects in that array and call <code>abstractMethod()</code> from any element in that array.</p> <p>However, that doesn't mean you're calling <code>abstractMethod()</code> from inside <code>EdumateSuperClass</code>, it'll still be a <code>Navigation</code> object that will contain the definition of <code>abstractMethod()</code> and be calling that from itself. I don't know if that makes it any clearer or not.</p> <p>Read up on <a href="http://download.oracle.com/javase/tutorial/java/IandI/polymorphism.html" rel="nofollow">polymorphism</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload