Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listeners & Interfaces

 
S. Stacey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ladies & Gents!!!
I am studying java and have run across interfaces and listeners that I am struggling with. My textbook is great with the theory but now I am looking for some practical help. Would anyone happen to know of any good web sites where I can get some help in interfaces & listeners?
Thanks for your help
Stacey
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about javaranch? Are you having problems writing code? Do you have specific questions about interfaces and listeners? Have you read any threads in the Applets or SwingJFC/AWT forums that might discuss specific problems about certain interfaces and/or listeners?
 
S. Stacey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marlyin,
Thanks for your reply. What I am having trouble with is writing the code. I have read through the theory in my textbook and I understand it but I am having trouble applying it...:-(
Stacey
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a problem, but need help understanding how to apply this material towards solving it -- or are you in search of an appropriate problem to apply it to?
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stacey,
I think I may know what your question means. I had a hard time in the begining understanding the "why" of interfaces. It gets much clearer over time as you write code. Here is a simple example that helped me:

One purpose of doing this sort of thing, is that you may have code that is using a "Shape" object. It know's that "Shape" provides a "numberOfSides" method, and so you can call that method without actually knowing what shape you are dealing with. You can imagine more complicated methods like getArea() that have differant calculations for the area of the shape based on if it is a square, triangle, circle, etc.
Not sure if this is the kind of info you were looking for or if this helps,
Hope so,
Kim
 
S. Stacey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that helps me out alot....THANKS
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic