OOP question in java

M

Mike Deliberto

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 @
(e-mail address removed)
Thanks in advance.
 
M

Mikkel Heisterberg

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top