[Techtalk] Java Question

Tricia Bowen tricia.bowen at gmail.com
Wed Apr 30 17:17:01 UTC 2008


Hi Sue,
Did not intend to reply privately but it happens when you hit the Reply
button real fast instead of the Reply to All button. A superclass might be
overkill but if you've got the time, overkill is a good way learn.
--Tricia

On Wed, Apr 30, 2008 at 10:50 AM, Sue Stones <suzo at spin.net.au> wrote:

> Thanks Tricia,
>
> (Did you intend to send me that reply privately?)
>
> Another good solution, I will have to think about which one is more
> appropriate.  I will have to think about that overnight and see if super
> classes are a more appropriate, or unnecessary work.  I suspect in this case
> that a super class is complicating things a little.
>
> I don't have a code snippet really, at least not anything that would help.
>  But what you have said has helped me any way.
>
> sue
>
>
>
> Tricia Bowen wrote:
>
> > Hi Sue,
> > Can you give a little code snippet of what you're trying to do or what
> > you've got so far? It sounds like you need to create a superclass with
> > various subclasses that each contain a different version of the run()
> > method. So regardless of what run was eventually called, the type would be
> > that of the superclass.
> >  Try this link for some information on superclasses:
> > http://www.faqs.org/docs/think_java/TIJ303.htm#Heading1072
> >  --Tricia
> >
> >
> >  On Wed, Apr 30, 2008 at 9:38 AM, Sue Stones <suzo at spin.net.au <mailto:
> > suzo at spin.net.au>> wrote:
> >
> >    Any Java Gurus out there?
> >
> >    Is it possible to pass a method as argument and return type in
> >    Java?  I
> >    was planning to do then realised I don't know how.  I have passed
> >    functions as arguments before, but now that I come to it realise
> >    it was
> >    probably in C.
> >
> >    I need to implement an interface (Runnable) where one method (run) is
> >    different under different circumstances.  Having a separate class
> >    which
> >    deals with the circumstances and returns the correct run method seems
> >    like the neatest way of solving this, but I can't think what the
> >    return
> >    type would be!  Googling the idea just brings lots of introductory
> >    pages
> >    about method arguments.
> >
> >    sue
> >    _______________________________________________
> >    Techtalk mailing list
> >    Techtalk at linuxchix.org <mailto:Techtalk at linuxchix.org>
> >    http://mailman.linuxchix.org/mailman/listinfo/techtalk
> >
> >
> >
> >
> > --
> > --Tricia
> >
>
>


-- 
--Tricia


More information about the Techtalk mailing list