Author Topic: [Java] Implementing Interfaces  (Read 3810 times)

0 Members and 1 Guest are viewing this topic.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
[Java] Implementing Interfaces
« on: April 04, 2006, 11:31:35 pm »
In my free time in Comp Prog, I'm writing an IRC client, but that's beside the point (mostly). I've written a EventCallbacks interface and implemented it in both SwingUI and ConsoleUI. I want to be able to pass the reference to the UI to the Connection class so that it can fire their callbacks. Do I just pass it as EventCallback UI or as a java.lang.Object, or what?

EDIT -
I may not be able to read this in the morning, so could you drop the answer in an email to wlafrance@baraboo.k12.wi.us as well, please? (It's for class, so eh?)
Thanks.
« Last Edit: April 04, 2006, 11:48:37 pm by Joe »
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: [Java] Implementing Interfaces
« Reply #1 on: April 05, 2006, 10:20:48 am »
You should be able to pass it as an EventCallback, if you're implementing EventCallback. 

Welcome to polymorphism...

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: [Java] Implementing Interfaces
« Reply #2 on: April 05, 2006, 11:14:08 am »
You should be able to pass it as an EventCallback, if you're implementing EventCallback. 

Welcome to polymorphism...

Hahaha, that's not far from what I told him.  ;)
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.