× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Joe Pluta wrote:
> 
> I'm a little unclear as to how tightly typed the type O variables are.
> If I declare a type O variable as class Widget, must I instantiate an
> object of type Widget to stick in there?  Can I use a subclass of
> Widget?  Can I use a class that's NOT a subclass, provided the method I
> later invoke has the same signature?
> 

RPG doesn't do any checking on Object types.  Java does all the checking
for validity so the rules are the same as they are for Java.  I think
Java does a class check on the instance parameter, so while RPG would
let you pass say a String object as the instance for a Widget method,
the call would fail.  But you can pass a MyWidget object, if MyWidget is
a subclass of Widget.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.