OOP question in java

Discussion in 'Java' started by Mike Deliberto, Jul 1, 2003.

  1. I have a question about oop in java. Here it is.Is it possible to give
    an abstract class inside an interface to an implemter class. This may
    help:

    public interface Top {
    void method1();
    void method2();
    public abstract class PassMe { };
    }

    public Bottom implements Top {
    void method1() {
    do stuff;
    }
    void method2() {
    do more stuff;
    }
    public class PassMe {
    int num;
    byte tht;
    void SomeOtherMethod() {
    do even more stuff
    }
    }
    PassMe hopefullySomeoneWillBeAbleToHelpMe = new PassMe();
    }

    If you need any clairifcation please e-mail me @

    Thanks in advance.
     
    Mike Deliberto, Jul 1, 2003
    #1
    1. Advertising

  2. I don't think that the code you posted will compile but the obvious
    thing would be to try... If what you want is to make implementers of an
    interface, implement an inner class based on the nested abstract class,
    I think the answer is definately no since an interface defines methods
    and not code i.e. the class.

    lekkim

    Mike Deliberto wrote:
    > I have a question about oop in java. Here it is.Is it possible to give
    > an abstract class inside an interface to an implemter class. This may
    > help:
    >
    > public interface Top {
    > void method1();
    > void method2();
    > public abstract class PassMe { };
    > }
    >
    > public Bottom implements Top {
    > void method1() {
    > do stuff;
    > }
    > void method2() {
    > do more stuff;
    > }
    > public class PassMe {
    > int num;
    > byte tht;
    > void SomeOtherMethod() {
    > do even more stuff
    > }
    > }
    > PassMe hopefullySomeoneWillBeAbleToHelpMe = new PassMe();
    > }
    >
    > If you need any clairifcation please e-mail me @
    >
    > Thanks in advance.
     
    Mikkel Heisterberg, Jul 1, 2003
    #2
    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. Piet den Dulk

    copy objects java OOP

    Piet den Dulk, Feb 4, 2004, in forum: Java
    Replies:
    3
    Views:
    12,148
    Oscar kind
    Feb 5, 2004
  2. antoine
    Replies:
    7
    Views:
    481
    Rhino
    Mar 3, 2005
  3. Sandy Miller
    Replies:
    0
    Views:
    291
    Sandy Miller
    Jan 8, 2008
  4. DBloke

    Java/OOP Question/Problem

    DBloke, Feb 7, 2008, in forum: Java
    Replies:
    23
    Views:
    891
  5. Sandy Miller
    Replies:
    0
    Views:
    346
    Sandy Miller
    Feb 18, 2008
Loading...

Share This Page