hi guys

Discussion in 'Java' started by ravi, Feb 8, 2006.

  1. ravi

    ravi Guest

    can any one tell me ,how to find out the interfaces that a class
    implements?
    dont say reflection i know that.
    but with out reflection?
    ravi, Feb 8, 2006
    #1
    1. Advertising

  2. ravi wrote:
    > can any one tell me ,how to find out the interfaces that a class
    > implements?
    > dont say reflection i know that.
    > but with out reflection?


    Reflection.

    Getting the implemented interfaces from a Class is a reflection activity.

    Class.getInterfaces(!) and Class.getGenericInterfaces are the methods
    you don't want.

    Without reflection. Well, I suppose you could use a debugging interface,
    looks at class files or indirectly use reflection (serialisation,
    beans, etc).

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
    Thomas Hawtin, Feb 8, 2006
    #2
    1. Advertising

  3. ravi

    Roedy Green Guest

    On 7 Feb 2006 22:09:20 -0800, "ravi" <> wrote,
    quoted or indirectly quoted someone who said :

    >can any one tell me ,how to find out the interfaces that a class
    >implements?
    >dont say reflection i know that.
    >but with out reflection?


    Are you asking someone who write you a little command line utility
    that does the dirty deed for you so you won't feel so guilty?
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Feb 8, 2006
    #3
  4. Hi ravi,

    ravi wrote:
    > can any one tell me ,how to find out the interfaces that a class
    > implements?
    > dont say reflection i know that.
    > but with out reflection?


    How do you read a book without opening it?

    There may be solutions (perhaps x-ray, computertomography, ... which
    Thomas, Roedy and paul mentioned) but (IMHO) the one and only practical
    solution is just to open the book the way it is supposed to.

    That means, concerning your problem: IMHO, there is no (practical)
    possibility to solve your problem.

    Why do you want to use no reflection? You seem to have a good reason
    (which I do not understand).

    Ciao,
    Ingo
    Ingo R. Homann, Feb 8, 2006
    #4
  5. ravi

    Oliver Wong Guest

    "ravi" <> wrote in message
    news:...
    > can any one tell me ,how to find out the interfaces that a class
    > implements?
    > dont say reflection i know that.
    > but with out reflection?


    Do you have to find out at runtime, or could you find out earlier? E.g.
    could you perhaps read the JavaDocs to find out what interfaces the class
    implements?

    - Oliver
    Oliver Wong, Feb 8, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    3
    Views:
    4,134
    Renaud Pacalet
    Oct 3, 2003
  2. Mike Dee
    Replies:
    0
    Views:
    365
    Mike Dee
    Nov 30, 2005
  3. -
    Replies:
    3
    Views:
    931
    Grant Wagner
    Jul 15, 2003
  4. Craig

    Sun's installation guys

    Craig, Aug 3, 2004, in forum: Java
    Replies:
    5
    Views:
    357
    Craig
    Aug 3, 2004
  5. Richard
    Replies:
    5
    Views:
    374
    Nico Schuyt
    Feb 14, 2005
Loading...

Share This Page