>
> Hello All,
>
> I have a question about the execute permission on doPerform in the
> Action.java class...
>
> In org.apache.turbine.modules.Action.java doPerform is defined as...
>
> protected abstract void doPerform( RunData data ) throws Exception;
>
>
> In org.apache.turbine.modules.actions... All the subclasses seem to be
> defined as
>
> public void doPerform( RunData data ) throws Exception
>
> My question is this. Is this legal Java. I have been under the impression
> that if you define an abstract method it must have the same attributes (ie
> it must also be protected...
>
> I know that the Turbine code compiles so my assumption must be wrong.
> Could someone shed some light on why changing a protected method to a
> public method would compile...
>
>From the Java Language Specification
<http://java.sun.com/docs/books/jls/html/8.doc.html>:

8.4.6.3 Requirements in Overriding and Hiding
...
The access modifier (§6.6) of an overriding or hiding method must provide at
least as much access as the overridden or hidden method, or a compile-time error
occurs. In more detail:
...
    -- If the overridden or hidden method is protected, then the overriding or
hiding method must be protected or public; otherwise, a compile-time error
occurs.
...

>
> Thanks Jeff Prickett
> [EMAIL PROTECTED]
>

--
Christopher Elkins





------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to